Yesh when you wtite to waking command do not mixt therewhat other characters is doing…even you use AND and it seem the script should get it…it often causes such errors.
also in general I recomannd to use less AND and more &.the efect that it happens together in one time is the same but the onger lines you make the harder it is to look up there mistake or typo. 