method to remove a node by ID