           Serial.println("HTTP_UPDATE_OK"); // may not called ESPhttpUpdate reboot the ESP?
           ESP.restart();
           break;
-        }
-        rf.enableReceiver();
+      }
+      rf.enableReceiver();
     } else {
       Serial.println("OTA authentication failed!");
     }

  Serial.print(" with protocol ");
  Serial.println(protocol);

  if(protocol == "RAW") {
    int rawpulses[MAXPULSESTREAMLENGTH];
    int rawlen = rf.stringToPulseTrain(message, rawpulses, MAXPULSESTREAMLENGTH);
    if(rawlen > 0) {
      rf.sendPulseTrain(rawpulses, rawlen);
    }
  } else {

      logMode = false;
    }
  }
  if (topic == (mainTopic + "/ota/url")) {
    otaURL = String(payload);
    mqtt.publish((mainTopic+ "/ota/nonce").c_str(), otaAuth.nonce().c_str());
  }
  if ((topic == (mainTopic + "/ota/passwd")) && (otaURL.length() > 7)) {
    if (otaAuth.verify(payload)) {
      beatLED.on();
      Serial.print("Start OTA update from: ");
      Serial.println(otaURL);
      rf.disableReceiver();
      t_httpUpdate_return ret = ESPhttpUpdate.update(otaURL);
      switch (ret) {
        case HTTP_UPDATE_FAILED:
          Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
          break;
