         }
 
         self.targetDevice = MeshDevice()
-
+        self.resetFlowFlags()
+
+        self.log("dataMatrix: \(dataMatrix)")
+        self.targetDevice.type = ParticleDeviceType(serialNumber: dataMatrix.serialNumber)
+        self.log("self.targetDevice.type?.description = \(self.targetDevice.type?.description as Optional)")
+        self.targetDevice.credentials = MeshSetupPeripheralCredentials(name: self.targetDevice.type!.description + "-" + dataMatrix.serialNumber.suffix(6), mobileSecret: dataMatrix.mobileSecret)
+
+        self.stepComplete()
+
+        return nil
+    }
+
+    private func resetFlowFlags() {
         //these flags are used to determine gateway subflow .. if they are set, new network is being created
         //otherwise gateway is joining the existing network so it is important to clear them
         //we cant use selected network, because that part might be reused if multiple devices are connected to same

                return
            }
            if (result == .NONE) {
                //reset all the important flags
                self.targetDevice.firmwareVersion = nil
                self.targetDevice.ncpVersion = nil
                self.targetDevice.ncpModuleVersion = nil
                self.targetDevice.supportsCompressedOTAUpdate = nil
                self.targetDevice.nextFirmwareBinaryURL = nil
                self.targetDevice.nextFirmwareBinaryFilePath = nil

                // reconnect to device by jumping back few steps in the sequence
                DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(5)) {

            }
        }
    }

    private func resetFirmwareFlashFlags() {
        //reset all the important flags
        self.targetDevice.firmwareVersion = nil
        self.targetDevice.ncpVersion = nil
        self.targetDevice.ncpModuleVersion = nil
        self.targetDevice.supportsCompressedOTAUpdate = nil
        self.targetDevice.nextFirmwareBinaryURL = nil
        self.targetDevice.nextFirmwareBinaryFilePath = nil

    }
}
