fixing a dict copy bug