Small Bug with Unit Training

Having an issue with a unit training building, in this case im using the barracks as a base unit.

I am using a trigger to replace the unit with a different barracks that summons different units. The trigger works fine.

The issue arises when after training a unit is completed, the ability based on channel, can no longer be used. it becomes disabled.

I tried writing another trigger to enable to ability after a unit training is cancelled, but that does not work.

Im also using the trigger to auto-summon units based on the last unit trained. I think the game is mistaking the barracks is ‘always’ in training unit mode and doesnt want to allow the ability to be enabled.