fix error message alert if cannot delete