fix bugs related to copying files/folders