fixed undef _G.scheduler crash