fix call to runTasks() in main loop