fixing node removal bug