add: check if node is valid before deleting