         WebServer.listener();
       }
     } else { // Device not connected to WiFi. Reestablish connection
-      Network.connect();
+      Network.listener();
     }
   } else { // Access Point Mode
     Network.APListener();

    Mqtt.begin();
  }

  Network.connect();

  /* Initializing HTTP WebServer */
  WebServer.handle("/", handleHTTPRequests);

          if (WebServer.httpAPIlistener()) {
            Led.on();
            processHTTPAPIRequest(WebServer.getHTTPCommand());
            Led.off();
          }
        }
