createOrders now works properly