fix bug in updating refs from a delete