implement the stop and reset functionality