Fixed a null Pointer Exception.

The schedule is created now