fixed resetting counter