fixing odd counter bug