I don’t have access to your script, can’t see it all. Swap things around, it has to make logical sense.