Fixed a bug in resetting the counter