fixed bug when copying input