fixed ordering by joined columns