     }
     serial_buffer[num_read] = 0;// terminate the string
     if (serial_buffer[0] || current_buffer[0]){
-      strcat(current_buffer, serial_buffer);
+      if (serial_buffer[0])
+        strcat(current_buffer, serial_buffer);
       
       #ifdef DEBUG
         Serial.write("initial buffer is=");

           sprintf(serial_out, "T#");
           i += 2;
         }
    }
    else
      i++;

  Serial.println(F("Ix# // Gets the value of infrared sensor x. Outputs Ix v#"));
  Serial.println(F("GMx# // Gets the parameters for motor x: speed acceleration num_sensors sensor_index1, sensor_type1 sensor_index1, sensor_type1. Outputs MPx s a 1 0 0#"));
  Serial.println(F("GPx# // Gets the parameters for potentiometer x: min max home. Outputs Px l u h#"));
  Serial.println(F("V# // Outputs version string. eg: 2016.01.17.0#"));

  
  Serial.println(F("Motor index is between 0 and num_motors - 1"));
  
  Serial.println();
#endif
  Serial.write("T#");// initialization is over; must check for T# string (which is the alive test)
}
//--------------------------------------------------------------------------------------------
