counter reset bug