use deepcopy instead of copy