fixed bug when copying