Moved Scheduler initialisation outside the execute method.