         }
     }
     
+    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        // Security section, hide TouchID if the device doesn't support
+        if section == 1 {
+            if hasTouchID() {
+                return 2
+            } else {
+                return 1
+            }
+        }
+        return super.tableView(tableView, numberOfRowsInSection: section)
+    }
+
     override func viewDidLoad() {
         super.viewDidLoad()
         NotificationCenter.default.addObserver(self, selector: #selector(SettingsTableViewController.actOnPasswordStoreErasedNotification), name: .passwordStoreErased, object: nil)

        tableView.deselectRow(at: indexPath, animated: true)
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
    }
    
    func touchIDSwitchAction(uiSwitch: UISwitch) {
        if !Globals.passcodeConfiguration.isTouchIDAllowed {
            // switch off
            uiSwitch.isOn = Defaults[.isTouchIDOn]  // false
            Utils.alert(title: "Notice", message: "Please set the passcode lock first.", controller: self, completion: nil)
        } else {
            Defaults[.isTouchIDOn] = uiSwitch.isOn
        }

        setPasscodeLockTouchIDCells()
    }
    
    private func hasTouchID() -> Bool {
        let context = LAContext()
        var error: NSError?
        if context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error) {
            return true
        } else {
            switch error!.code {
            case LAError.Code.touchIDNotEnrolled.rawValue:
                return true
            case LAError.Code.passcodeNotSet.rawValue:
                return true
            default:
                return false
            }
        }
    }
    
    private func isTouchIDEnabled() -> Bool {
        let context = LAContext()
        return context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil)
    }
    
    private func setPasscodeLockTouchIDCells() {
        if PasscodeLockRepository().hasPasscode {
            self.passcodeTableViewCell.detailTextLabel?.text = "On"
