added small fix to the scheduler