Fixed a scheduling bug