fixed bug in copy