   }
 // or Join existing network
   else if (accesspointmode != 1) {
-    ESP.eraseConfig();
     WiFi.disconnect(true);
     WiFi.mode(WIFI_STA);
 //    Serial.print("Setting up Network Configuration ... ");

  json["autopwn"] = autopwn;
  json["autopayload"] = autopayload;

  File configFile = SPIFFS.open("/config.json", "w");
  json.printTo(configFile);
  return true;
}

  json["LivePayloadDelay"] = "3000";
  json["autopwn"] = "0";
  json["autopayload"] = "/payloads/payload.txt";
  File configFile = SPIFFS.open("/esploit.json", "w");
  json.printTo(configFile);
  loadConfig();
}

bool loadConfig() {
  File configFile = SPIFFS.open("/esploit.json", "r");
  if (!configFile) {
    loadDefaults();
  }
