*fixed copy function