Remove begin block in copy_file to raise error when fail