        Serial.println(F("enable 1 done"));
      }
     }
-    if(num == 2){
+    if(state == 2){
       if(!rbc_mesh_value_enable((uint8_t) 2)){
        Serial.println(F("enable 2 dropped"));
      }

       Serial.println(F("enable 2 done"));
     }
    }
    if(num > 2){
      uint8_t on = (num/2) % 2;
      uint8_t handle = (num % 2) + 1;
      if(handle == 1) {
		rbc_mesh_value_set((uint8_t)2, &on, (uint8_t) 1);
       		Serial.println(F("set done"));
	}
      if(handle == 2){
		rbc_mesh_value_get((uint8_t) 2);
       		Serial.println(F("get done"));
	}

    }

    // clear the uart_buffer:

       Serial.println(F("echo done"));
     }
    }
    
    // initialization: enable the handles
    if(state == 1){
      if(!rbc_mesh_value_enable((uint8_t) 1)){
       Serial.println(F("enable 1 dropped"));
     }
