Fixed issue with getDistance() not returning a value