         else { return }
         
         let trimmedLastWord = lastWord.trimmingCharacters(in: .whitespaces)
-        _ = collection.map {
-            if tagCharacter + $0 == trimmedLastWord {
+        for index in 0...collection.count-1 {
+            if tagCharacter + collection[index] == trimmedLastWord || chosenTags.contains(trimmedLastWord) {
                 updateContainedAttributedText()
                 containedAttributedText.replaceCharacters(in: NSMakeRange(containedAttributedText.string.characters.count - trimmedLastWord.characters.count,
                                                                           trimmedLastWord.characters.count), with: "")
                 userTextField.attributedText = containedAttributedText
+                
+                guard let index = chosenTags.index(of: trimmedLastWord) else { return }
+                chosenTags.remove(at: index)
+                break;
             }
         }
         translateCompletionTextHolderDown(with: nil)

    
    public func textFieldShouldClear(_ textField: UITextField) -> Bool {
        containedAttributedText = NSMutableAttributedString()
        return true
    }
}

    private var userTextField: UITextField!
    
    private var collection = [String]()
    private var chosenTags = [String]()
    private var tagCharacter = String()
    private var containedAttributedText = NSMutableAttributedString()
    
