delete the node when finished