Due External Interrupts

Might be worth to try it with a SR Latch on the input.
This way it would eliminate any input issues