fix bugs in dict, dict is applicable