Fix error and get location by distance