       toggle_time = millis();
     }
 
-    // soft timer expires, this should be long enough, 20 seconds
-    if (end_time - start_time > DELAY_IN_WAIT/50) {
+    // soft timer expires, this should be long enough, 5 seconds
+    if (end_time - start_time > DELAY_IN_WAIT/200) {
       DEBUG_PRINTLN("[PENDING] Timer expires, back to IDLE");
       // timeout, return to IDLE
       state = IDLE;

	}
      }
      if (atoi(p.id) == atoi(deviceId) && p.type[0] == 'd') {
      	// disconnected message
      	DEBUG_PRINTLN("[IDLE] entering state");
      	state = IDLE;
        irrecv.resume();
      }
    }

    }
    
    if(XBee.available()) {
      start_time = millis();
      // delay for the complete of transmission
      delay(10);
      DEBUG_PRINTLN("[WAIT] Reading Packet");
