fixed bugs in createOrder