                     sprintf(serial_out, "GU%d %d %d#", ultrasound_index, trig_pin, echo_pin);
                     i += 4;
                   }
+                  else
+                    i++;// incomplete string
         }
         else
          if (tmp_str[i] == 'T' || tmp_str[i] == 't'){// test connection

            }
            else
              i++;// error on incomplete string (does nothing)
        }  
      }
      else
          if (tmp_str[i] == 'P' || tmp_str[i] == 'p'){// potentiometer            

                 sprintf(serial_out, "CI#");
                 i += num_consumed_total;
               }
               else
                 i++; // incomplete string
         }
         else
           i++;// incomplete string
    }
    else
      i++;
