fixed infinite loop in failed delete