fix: should calculate the distance correctly if stdv is 0