fix bugs in orders