diff --git a/app/src/main.cpp b/app/src/main.cpp
index 3996f620436165673344f11039293674e02a00e1..ddfbbdf17454e39fb59ddec1d1c37a58597a5aa4 100644
--- a/app/src/main.cpp
+++ b/app/src/main.cpp
@@ -14,14 +14,14 @@
 int main(int argc, char *argv[])
 {
     // Init
-    auto appDirPath = QGuiApplication::applicationDirPath();
+    QGuiApplication app(argc, argv); // This is backend program, but need GUI module
+
+    auto appDirPath = app.applicationDirPath();
     auto envPath = appDirPath + ":" + appDirPath + "/usr/bin:" + QString::fromLocal8Bit(qgetenv("PATH").constData());
     qputenv("PATH", envPath.toUtf8().constData());
 
     qDebug() << QString::fromLocal8Bit(qgetenv("PATH").constData());
 
-    QGuiApplication app(argc, argv); // This is backend program, but need GUI module
-
     auto *configHandler = new ConfigHandler(&app);
     auto appConfigApplication = configHandler->getAppConfigApplication();