added eachNode callback