Add check to getDistanceTo