Fixed a severe issue of the scheduler