implemented copyFile