Avoid stray pulses, jitter, use two d-flipflops, or integrate pulse duration