update add_node method