 
 void update_hsnmea()
 {
-  while(soft_serial.available() && (int) hsnmea_read_buffer.length() < MAX_NMEA_BUFFER)
+  bool keep_going = true;
+  while(soft_serial.available() && (int) hsnmea_read_buffer.length() < MAX_NMEA_BUFFER && keep_going == true)
   {
     int incoming_byte = soft_serial.read();
     if(incoming_byte == '\n')

      }
      #endif
      hsnmea_read_buffer = "";
    }
    else if (incoming_byte == '\r')
    {

         parse_nmea_sentence();
       }
       nmea_read_buffer = "";
       keep_going = false;
     }
     else if (incoming_byte == '\r')
     {
