caught some errors with the add_node() function