fixed ball distance calculation error