fix to --delete-existing code