   //set default control mode (0 - RGB, 1 - HSB)
   pos = req.indexOf("MD=");
   if (pos > 0) {
-    useHSB = req.substring(pos + 3).toInt();
+    useHSB = getNumVal(&req, pos);
   }
   //set advanced overlay
   pos = req.indexOf("OL=");
   if (pos > 0) {
-    overlayCurrent = req.substring(pos + 3).toInt();
+    overlayCurrent = getNumVal(&req, pos);
     strip.unlockAll();
   }
   //(un)lock pixel (ranges)
   pos = req.indexOf("&L=");
   if (pos > 0){
-    int index = req.substring(pos + 3).toInt();
+    int index = getNumVal(&req, pos);
     pos = req.indexOf("L2=");
     if (pos > 0){
-      int index2 = req.substring(pos + 3).toInt();
+      int index2 = getNumVal(&req, pos);
       if (req.indexOf("UL") > 0)
       {
         strip.unlockRange(index, index2);

  //set brigthness
  pos = req.indexOf("&A=");
  if (pos > 0) {
    bri = req.substring(pos + 3).toInt();
  }

  //set hue
  pos = req.indexOf("HU=");
  if (pos > 0) {
    uint16_t temphue = req.substring(pos + 3).toInt();
    byte tempsat = 255;
    pos = req.indexOf("SA=");
    if (pos > 0) {
      tempsat = req.substring(pos + 3).toInt();
    }
    colorHStoRGB(temphue,tempsat,(req.indexOf("H2")>0)? colSec:col);
  }

  
  pos = req.indexOf("PS="); //saves current in preset
  if (pos > 0) {
    savePreset(getNumVal(&req, pos));
  }
  pos = req.indexOf("PL="); //applies entire preset
  if (pos > 0) {
    applyPreset(getNumVal(&req, pos), presetApplyBri, presetApplyCol, presetApplyFx);
  }
  
  //cronixie
