removed app->exec() but still trying to write outside of speficications