issue #4861. fix distance calculation