fix bugs in create_order