updated deepcopy logic of compound