Why are you doing a deepcopy and then clearing the variable?