Added error checking to dangle remove