fixed an edge case bug when a nodebecause empty and needs to be deleted