bugs in getting rid of dictionary