detachInterupt() from the inside of the interupt function?

How about immediately returning from the ISR if it has been called the requisite number of times ?

Incidentally, i should be declared volatile.