         alert.addTextFieldWithConfigurationHandler({(textField: UITextField!) in
             textField.placeholder = "<folder name>"
             textField.secureTextEntry = false
+            NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(self.notificationReceived(_:)), name: UITextFieldTextDidChangeNotification, object: textField)
         })
         
         self.presentViewController(alert, animated: true) {}
     }
 
     func addFolder(alert: UIAlertAction!, alertController: UIAlertController) {
-        if let folderName = alertController.textFields?[0].text  {
+        if let folderName = alertController.textFields?[0].text {
             if let sqllitbk = self.profile.bookmarks as? MergedSQLiteBookmarks {
                 sqllitbk.createFolder(folderName).upon { _ in
                     postAsyncToMain {

    var addRemoveFolderButton:UIBarButtonItem!
    var removeFolderButton:UIBarButtonItem!
    var addFolderButton:UIBarButtonItem!
    
    var isEditingInvidivualBookmark:Bool = false

    init() {

    func onAddBookmarksFolderButton() {
        
        let alert = UIAlertController(title: "New Folder", message: "Enter folder name", preferredStyle: UIAlertControllerStyle.Alert)
        
        let removeTextFieldObserver = {
            NSNotificationCenter.defaultCenter().removeObserver(self, name: UITextFieldTextDidChangeNotification, object: alert.textFields!.first)
        }

        let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default) { (alertA: UIAlertAction!) in
            postAsyncToMain {
                self.addFolder(alertA, alertController:alert)
            }
            removeTextFieldObserver()
        }
        
        okAction.enabled = false
        
        addBookmarksFolderOkAction = okAction
        
        let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel) { (alertA: UIAlertAction!) in
            removeTextFieldObserver()
        }
        
        alert.addAction(okAction)
        alert.addAction(cancelAction)
