Interrupts getting ignored

The Arduino is failing when you switch the motor on?

I guess that points to a power problem.

Do you have a proper power supply for the motor?