fix NPE during remove bad node