handle error on delete