Corrected reset to stop prepare thread