fix bug in change_pattern
and add stage to order_schedule