     
     public func updateRightButtonText(_ newText: String?) {
         
+        
+        
         if let barButtonItems = textViewToolbar.items, let newText = newText {
             
-            rightButtonText = newText
-            
             var updatedBarButtonItems : [UIBarButtonItem] = []
-            let rightBarButton: UIBarButtonItem = UIBarButtonItem(title: newText, style: .done, target: self, action:#selector(rightButtonAction))
-            
             updatedBarButtonItems.append(barButtonItems[0])
             updatedBarButtonItems.append(barButtonItems[1])
+            
+            // clear current toolbar.
+            textViewToolbar.items = nil;
+            
+            // build the updated right hand button.
+            rightButtonText = newText
+            
+            //let rightBarButton: UIBarButtonItem = UIBarButtonItem(title: newText, style: .done, target: self, action:#selector(rightButtonAction))
+            var rightBarButton: UIBarButtonItem = UIBarButtonItem()
+            
+            if let rightButtonText = rightButtonText {
+                rightBarButton = generateRightBarButton(rightButtonText)
+            }
+            
+//            rightBarButton.target = self
+//            rightBarButton.action = #selector(rightButtonAction)
+//
+            
             updatedBarButtonItems.append(rightBarButton)
             
             textViewToolbar.items = updatedBarButtonItems

        }
        
        if let rightButtonText = rightButtonText {
            let rightBarButton: UIBarButtonItem = UIBarButtonItem(title: rightButtonText, style: .done, target: self, action:#selector(rightButtonAction))
            barButtonItems.append(rightBarButton)
        }
        

        textViewToolbar.sizeToFit()
        
        textView.inputAccessoryView = textViewToolbar
    }
    
// Bar Button Generation
    
    func generateLeftBarButton(_ title: String) -> UIBarButtonItem {
        let leftBarButton = UIBarButtonItem()
        leftBarButton.target = self
        leftBarButton.action = #selector(leftButtonAction)
        leftBarButton.title = title
        
        return leftBarButton
    }
    
    func generateRightBarButton(_ title: String) -> UIBarButtonItem {

        let rightBarButton = UIBarButtonItem()
        rightBarButton.target = self
        rightBarButton.action = #selector(rightButtonAction)
        rightBarButton.title = title
        
        return rightBarButton
    }
    
// Toolbar Action Methods
