Added an autoreset property and resetting funtionality