fix orderby totals bug