Added position validation to findNearest