Handle error when resource is removed