fixed bug in scheduler context switch, thanks Niphlod