text: You don't choose the new target for the spell or ability targeted with Untimely Malfunction's second mode until Untimely Malfunction resolves. You must change the target if possible. However, you can't change the target to an illegal target. If there are no legal targets to choose from, the target isn't changed. It doesn't matter if the original target has somehow become illegal itself.