fixbug: a character is lost everytime the count equals max_wordlen