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

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

    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 {
        if unbracketedTitleLabel == name {
          labelsToAdd.append(titleLabel)
          break
        } else if PRLabelAnalysis.checkIfTwoStringsAreSimilar(str1: name,
                                                              str2: unbracketedTitleLabel,
                                                              threshold: 2) {
          let bracketedName = "[" + name + "]"
          labelsToAdd.append(bracketedName)

          // update title
          if let range = issueData.title.range(of: "]") {
            let titleWithoutLabel = titleLabel[range.upperBound...]
            var updatedTitle = bracketedName
            if titleWithoutLabel.first != " " {
