fixed scheduling bug