Fixed scheduling bug