added checking order status before changing it