Why didn't you just start the trigger with a 0, and use the 1 to reset, instead of using code to invert it?
0
1