fixed counter bug