deepCopy function fixed . #6