     override func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
         let footer = UIView(frame: CGRectMake(0, 0, tableView.frame.size.width, 40));
         footer.backgroundColor = UIColor.colorWithHex("#EEEEEE")
-        if (section == 1) {
+        
+        if (section == 1 || section == 2) {
             let border = CALayer();
             border.frame = CGRectMake(0, 0, tableView.frame.size.width, 0.5)
             border.backgroundColor = UIColor.colorWithHex("#CCCCCC")?.CGColor

        
        return footer
    }
}


            passwordField.text = pass
        }
        
        if let darkOn = config.valueForKey("useDarkTheme") as? Bool {
            darkThemeSwitch.on = darkOn
        }
        
        if let autoOn = config.valueForKey("useAutoTheme") as? Bool {
            themeAutoSwitch.on = autoOn
            darkThemeSwitch.on = false // these are mutually excluded
            config.setBool(false, forKey: "useDarkTheme")
        }
        
        passwordField.secureTextEntry = !showPasswordSwitch.on
    }
    
    
    @IBAction func handleDarkThemeChange(sender: UISwitch) {
        println("dark theme toggle changed: \(sender.on)")
        
        config.setBool(sender.on, forKey: "useDarkTheme")
        config.setBool(!(sender.on), forKey: "useAutoTheme")
    }
    
    
    @IBAction func handleShowPasswordChange(sender: UISwitch) {
        println("show password toggle changed: \(sender.on)")
        
        passwordField.secureTextEntry = !sender.on
        config.setBool(sender.on, forKey: "showPassword")
    }
    
    @IBAction func handleDonePressed(sender: AnyObject) {
        config.setObject(passwordField.text, forKey: "password")
        
        self.passwordField.resignFirstResponder()
        self.dismissViewControllerAnimated(true, completion: nil)
        
        println("modal closed: \(passwordField.text)")
        
        nc.postNotificationName("settingsUpdated", object: config)
        
    }
    
    @IBAction func handleCancelPressed(sender: AnyObject) {
        self.dismissViewControllerAnimated(true, completion: nil)
        println("modal closed")
        
    }
    
    func modalClosed() -> Void {
    }

    
    /// Iterating over the sections in the table view to update the 
    /// appearance by changing font and case to make it look more like the
    /// standard settings view in the settings app
    ///
    /// :return: UIView
    override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        let header = UIView(frame: CGRectMake(0, 0, tableView.frame.size.width, 28))

        header.backgroundColor = UIColor.colorWithHex("#EEEEEE")
        
        if (section == 1) {
            
            let text   : UILabel = self.getLabel()
            let border : CALayer = self.getBottomBorder()
            
            text.text = String("authentication").uppercaseString
            
            header.addSubview(text)
            header.layer.addSublayer(border)
        }
        
        if (section == 2) {
            let text   : UILabel = self.getLabel()
            let border : CALayer = self.getBottomBorder()
            
            text.text = String("Theme").uppercaseString
            
            header.addSubview(text)
            header.layer.addSublayer(border)
        }
        
        return header
