deepcopy hash before modifying it