 void setup() {
   // Set serial port
   Serial.begin(115200); 
-  // Use the led 13 to notify that the
-  // setup completed
-  pinMode(13,OUTPUT);
-  digitalWrite(13, HIGH);
+  // Default on
+  pinMode(RELAYPIN, OUTPUT);
+  digitalWrite(RELAYPIN, LOW);
   // Init bridge library
   Bridge.begin();
-  // Default on
-  pinMode(RELAYPIN,OUTPUT);
-  digitalWrite(RELAYPIN, LOW);
   // Loading setting 
   eeprom_read_block((void*)&settings, (void*)0, sizeof(settings));
   if (strcmp(settings.magic, MAGIC) != 0) {

    if (subCommand == "switch") {
      char c = client.read();
      if (c == '0') {
        digitalWrite(RELAYPIN, 0);
      } 
      if (c == '1') {
        digitalWrite(RELAYPIN, 1);
      } 
      sendReply(client,subCommand,digitalRead(RELAYPIN));
      return;

  // listen on port
  server.listenOnLocalhost();
  server.begin();
  // Use the led 13 to notify that the
  // setup completed
  pinMode(13,OUTPUT);
  digitalWrite(13, HIGH);
}

void loop() {
