handle error when the file is not saved