Now correctly adding schedules to database.