     let componentNames = GithubAPI.getDirectoryContentPathNames(relativePath: "/components")
     var labelsToAdd = [String]()
     if let titleLabel = PRLabelAnalysis.getTitleLabel(title: issueData.title) {
+      let unbracketedTitleLabel = String(titleLabel.dropFirst().dropLast())
       for name in componentNames {
-        let bracketedName = "[" + name + "]"
-        if titleLabel == bracketedName {
+        if unbracketedTitleLabel == name {
           labelsToAdd.append(titleLabel)
           break
-        } else if PRLabelAnalysis.checkIfTwoStringsAreSimilar(str1: bracketedName, str2: titleLabel, threshold: 7) {
+        } else if PRLabelAnalysis.checkIfTwoStringsAreSimilar(str1: name,
+                                                              str2: unbracketedTitleLabel,
+                                                              threshold: 2) {
+          let bracketedName = "[" + name + "]"
           labelsToAdd.append(bracketedName)
 
           // update title
-          if let range = titleLabel.range(of: "]") {
+          if let range = issueData.title.range(of: "]") {
             let titleWithoutLabel = titleLabel[range.upperBound...]
             var updatedTitle = bracketedName
             if titleWithoutLabel.first != " " {

    labelsToAdd.append(contentsOf: labelsFromPaths)
    if let titleLabel = PRLabelAnalysis.getTitleLabel(title: PRData.title) {
      // check if there is a title label but it needs fixing.
      for label in labelsFromPaths {
        if label == titleLabel {
          break
        } else if PRLabelAnalysis.checkIfTwoStringsAreSimilar(str1: titleLabel, str2: label, threshold: 7) {
          if let range = titleLabel.range(of: "]") {
            let titleWithoutLabel = titleLabel[range.upperBound...]
            var updatedTitle = label
            if titleWithoutLabel.first != " " {

            } else {
              updatedTitle += titleWithoutLabel
            }
            GithubAPI.editIssue(url: issueData.url, issueEdit: ["title": updatedTitle])
            // notify of title change
            GithubAPI.createComment(url: issueData.url,
                                    comment: "Your title label prefix has been renamed from \(titleLabel) to \(bracketedName).")
          }
          break
        }
