fix reference update on delete

Shouldn't this be equivalent to simply var resourceId = resource.id; at this stage?