allow using getdistance function in order clause