fixed a counter bug