Additional check in update_node_networks function