fixed character counter bug