fixed error handling in placeOrder call