add minDistance option