   }
 // form data is the last line 
   client.flush();
+  String message;
   String response;
-  String message = "";
-  String somessid = getParam(req,"ssid");
-  if (somessid != "") {
+  String reply = getParam(req,"ssid");
+  if (reply != "") {
       ssid =getParam(req,"ssid");
       password = getParam(req,"password");
       stream_id = getParam(req,"stream_id");

void startAP() {
  Serial.println("Configuring access point...");
  Serial.println(String("ssid ")+ap_ssid+" password "+ ap_password);
  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 != "")  {
         response= String("<div><h1>trying to connect</h1> If it fails, you will have to close the connection and reconnect</div>");
         httpReturn(response);
         delay(1000);
         wifi_connected = connectWiFi();
         ap_started= false;
         if (wifi_connected){
           putConfiguration();
         }
         return;
      }
     }
  }
// return form 
