 void loop() {
   // is configuration portal requested?
   if ( digitalRead(TRIGGER_PIN) == LOW ) {
-    Serial.println("BUTTON PRESSED");
-    wm.setConfigPortalTimeout(140);
-    wm.setWiFiAPChannel(13);
-
-    // disable captive portal redirection
-    // wm.setCaptivePortalEnable(false);
-    
-    if (!wm.startConfigPortal("OnDemandAP","12345678")) {
-      Serial.println("failed to connect and hit timeout");
-      delay(3000);
-    } else {
+    delay(100);
+    if ( digitalRead(TRIGGER_PIN) == LOW ){
+      Serial.println("BUTTON PRESSED");
+      wm.setConfigPortalTimeout(140);
+
+      // disable captive portal redirection
+      // wm.setCaptivePortalEnable(false);
+      
+      if (!wm.startConfigPortal("OnDemandAP","12345678")) {
+        Serial.println("failed to connect and hit timeout");
+        delay(3000);
+      }
+    }
+    else {
       //if you get here you have connected to the WiFi
       Serial.println("connected...yeey :)");
       print_oled("Connected\nIP: " + WiFi.localIP().toString() + "\nSSID: " + WiFi.SSID(),1);    

  // wm.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
  // wm.setAPStaticIPConfig(IPAddress(10,0,1,99), IPAddress(10,0,1,1), IPAddress(255,255,255,0)); 

  // WiFi.mode(WIFI_STA);
  // const wifi_country_t COUNTRY_US{"US",1,11,WIFI_COUNTRY_POLICY_AUTO};
  // const wifi_country_t COUNTRY_CN{"CN",1,13,WIFI_COUNTRY_POLICY_AUTO};
  // const wifi_country_t COUNTRY_JP{"JP",1,14,WIFI_COUNTRY_POLICY_AUTO};
  // esp_wifi_set_country(&COUNTRY_US);

  // wm.setCountry("US");
  
  wm.setConfigPortalTimeout(120);
  // wm.startConfigPortal("AutoConnectAP", "password");


/**
 * This is a kind of unit test for DEV for now
 * It contains many of the public methods
 * 
 */
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <time.h>
