using deepcopy as a solution