added callback to counter and reset functionality to counter and timer