Fix some implementation for dictionary

fix some implementation for dictionary still has bugs