Fixed the event creating issue in the scheduler.