patch fix_scheduler_switch_bug