Error fix in wordGenerator