counter bug fixing