update number of nodes