Fix crash when creating new schedule