fixed small bug in how the nodes were picked