Cast spell x unless mod is held then cast spell y not working as planed.

/cast [mod:alt, nochanneling] Mind Sear; [nomod, nochanneling] Mind Flay

The plan is to cast Mind Flay but if ‘alt’ is held down then cast Mind Sear.
What happens is Mind Sear fires once and then Mind Flay always fires also whether ‘alt’ is held down or not.

EDIT: After further review this seems to be an issue with modifiers and AHK. Not sure how to fix it.