changed js for creating a new order