changed to deep copy