Fixed the bug where the character count wasn't visible, improved the code.