save file before deleting it to avoid the prompt