fix bug for not passing num_nodes