diff --git a/src/Utils.ts b/src/Utils.ts
index cb76107..77ea52f 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -2,6 +2,7 @@ import * as dns from "dns";
 import * as fs from "fs";
 import * as https from 'https';
 import path from "path";
+import {Settings} from "./Settings";
 
 export class Utils {
     public static checkInternet(): Promise<boolean> {
@@ -61,4 +62,26 @@ export class Utils {
         return fs.existsSync("./public/images/" + id + ".png");
     }
 
+    static waitForReady(timeout: number = 0): Promise<void> {
+        let millis = 0;
+        return new Promise((resolve, reject) => {
+            function wait() {
+                millis += 100;
+                if (Settings.setupDone) {
+                    resolve()
+                    return;
+                }
+                if (timeout != 0 && timeout <= millis) {
+                    reject();
+                    return;
+                }
+
+                setTimeout(() => wait(), 100);
+            }
+
+            setTimeout(wait, 100);
+        });
+
+
+    }
 }
\ No newline at end of file
diff --git a/src/main.ts b/src/main.ts
index 37d84cd..78d8a57 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -33,22 +33,15 @@ const wsApp = new WebsocketApp();
         }
 
 
-        function checkStart() {
-            setTimeout(async () => {
-                if (!Settings.setupDone) {
-                    checkStart();
-                    return;
-                }
-                Settings.saveSettings();
+        log("Waiting for ready status...");
+        await Utils.waitForReady();
 
-                log("Check OK, starting...");
-                await init();
-                setInterval(refresh, 1000 * 60);
-                iTender.setStatus(iTenderStatus.READY);
-            }, 1000);
-        }
+        Settings.saveSettings();
 
-        checkStart();
+        log("Check OK, starting...");
+        await init();
+        setInterval(refresh, 1000 * 60);
+        iTender.setStatus(iTenderStatus.READY);
 
     } catch (e) {
         console.error("---- ERROR ----");