 void startAP() {
   Serial.println("Configuring access point...");
   Serial.println(String("ssid ")+ap_ssid+" password "+ ap_password);
+  WiFi.disconnect();
   boolean result = WiFi.softAP(ap_ssid, ap_password);
   Serial.println(String("SoftAP return ") + result);
   delay(100);

      String doConnect = getParam(req,"connect");
      
      if (doConnect =="Yes" && ssid != "")  {
      putConfiguration();
      wifi_connected = connectWiFi();
      if (wifi_connected) {
          response = String("<h1>Connecting to access point Bye Bye</h1>");
  
          httpReturn(response);
          // stop the ap - how ?
          ap_started = false;
          // stop the server - how ?
          return;
      }
      message = "Wifi not connected";
     }
  }
// return form 

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
    blink(4,5,10);
    tries++;
    if (tries > 20 ) 
      return false;
  }

  Serial.println("");
  Serial.println("WiFi connected");
  blink(2,100,500);
