fix bug in nearestNeighbor