fixed stupid error in getDistance