         ///////////////////////////////////////////
         if msg.type == .simple {
           decoded = true
-          let name = msg.simpleMessage.name
+          let name = msg.simpleMessage.name as NSString
           
           // build measurement message
           let rsp : VehicleMeasurementResponse = VehicleMeasurementResponse()
           rsp.timestamp = Int(truncatingBitPattern:msg.timestamp)
-          rsp.name = msg.simpleMessage.name as NSString
+          rsp.name = name
           if msg.simpleMessage.value.hasStringValue {rsp.value = msg.simpleMessage.value.stringValue as AnyObject}
           if msg.simpleMessage.value.hasBooleanValue {rsp.value = msg.simpleMessage.value.booleanValue as AnyObject}
           if msg.simpleMessage.value.hasNumericValue {rsp.value = msg.simpleMessage.value.numericValue as AnyObject}

  
  
  // return the latest message received for a given measurement string name
  open func getLatest(_ key:NSString) -> VehicleMeasurementResponse {
    if let entry = latestVehicleMeasurements[key] {
      return entry as! VehicleMeasurementResponse
    }
    return VehicleMeasurementResponse()
  }
  
  

      }

      // clear any saved context
      latestVehicleMeasurements.removeAll()
      
      // update the connection state
      connectionState = .connectionInProgress
