fixed some bugs in the dictionary