fix node deletion bug