added character counter and update UI elements depending on count