fixed some bugs in addWord