Interrupt issue

The counting of teeth should be 16 that was handled by an interrupt to turn the relay and motor off , but the problem occurs more frequently with the other interrupt that used to turn on the relay and motor, which handled by a proximity sensor that is triggered for every half rotation of another gear.