fix for counter reset