correction in node selection algorithm