fixed copy functions