Fixing display bug in wordCount method