repaired bug fixes in the scheduler