remove links when a node is removed