sorting correctly on the orders page