mainLoop is added.