Fixing issue where newly renamed destination file would be deleted