pass node id to the callback in forEachNode