Added a reset timeout function