-. bug fix in toOrders