bugfix in the scheduler