changed the update_nodes call logic