[fix] correct distance calculation and searching scope