use deepcopy in to_json