Problem solved.

All I have to do is to put a variable switch in the waveInProc to disallow entry before the waveInReset is called.