hotfix: inversed filename check in copy_to