             }
         }
     }
+
+    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
+
+    }
 }

        }

        self.targetDevice = MeshDevice()

        //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

        self.userSelectedToLeaveNetwork = nil
        self.userSelectedToUpdateFirmware = nil



    //MARK: ConnectToTargetDevice
    private func stepConnectToTargetDevice() {
