Some changes for locks in Scheduler