fixed copy routine