half done mainLoop fix