Fix bug in whenever schedule, add missing bracket