diff --git a/src/Plugin/Validation/Constraint/NodeTitleConstraintValidator.php b/src/Plugin/Validation/Constraint/NodeTitleConstraintValidator.php
index 14b53fc..09f9185 100644
--- a/src/Plugin/Validation/Constraint/NodeTitleConstraintValidator.php
+++ b/src/Plugin/Validation/Constraint/NodeTitleConstraintValidator.php
@@ -6,6 +6,7 @@ use Drupal\Core\Config\ConfigFactory;
 use Drupal\Core\Entity\EntityTypeManager;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\Core\StringTranslation\TranslationInterface;
+use Drupal\node\NodeInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\ConstraintValidator;
@@ -63,40 +64,66 @@ class NodeTitleConstraintValidator extends ConstraintValidator implements Contai
    * {@inheritdoc}
    */
   public function validate($items, Constraint $constraint) {
+    /** @var \Drupal\Core\Field\FieldItemListInterface $items */
+    // Make sure the field is not empty.
     if ($items->isEmpty()) {
       return;
     }
-    $value_title = $items[0]->value;
-    $title = explode(' ', $value_title);
-    $node_type = $items[0]->getEntity()->getType();
-    $node_title_validation_config = $this->configFactory->getEditable('node_title_validation.node_title_validation_settings')
+
+    // Get the user entered title.
+    $value_title = $items->value;
+    if (empty($value_title)) {
+      return;
+    }
+
+    // Get host node.
+    $node = $items->getEntity();
+    if (!$node instanceof NodeInterface) {
+      return;
+    }
+
+    // Get host node type.
+    $node_type = $node->getType();
+    if (empty($node_type)) {
+      return;
+    }
+
+    // Check if module config exists.
+    $node_title_validation_config = $this->configFactory
+      ->getEditable('node_title_validation.node_title_validation_settings')
       ->get('node_title_validation_config');
-    if ($node_title_validation_config) {
-      // Add a comma if comma is blacklist.
-      $exclude_comma = [];
-      if (!empty($node_title_validation_config['comma-' . $node_type])) {
-        $exclude_comma[] = ',';
-      }
-      // Get exclude values for current content type.
-      $type_exclude = isset($node_title_validation_config['exclude-' . $node_type]) ? $node_title_validation_config['exclude-' . $node_type] : '';
+    if (empty($node_title_validation_config)) {
+      return;
+    }
 
-      if (!empty($type_exclude) || $exclude_comma) {
-        // Replace \r\n with comma.
-        $type_exclude = str_replace("\r\n", ',', $type_exclude);
-        // Store into array.
-        $type_exclude = explode(',', $type_exclude);
+    $title = explode(' ', $value_title);
+    $nodeStorage = $this->entityTypeManager->getStorage('node');
 
-        $type_exclude = array_merge($type_exclude, $exclude_comma);
+    // Add a comma if comma is blacklist.
+    $exclude_comma = [];
+    if (!empty($node_title_validation_config['comma-' . $node_type])) {
+      $exclude_comma[] = ',';
+    }
+    // Get exclude values for current content type.
+    $type_exclude = isset($node_title_validation_config['exclude-' . $node_type]) ? $node_title_validation_config['exclude-' . $node_type] : '';
 
-        // Find any exclude value found in node title.
-        $findings = _node_title_validation_search_excludes_in_title($value_title, $type_exclude);
+    if (!empty($type_exclude) || $exclude_comma) {
+      // Replace \r\n with comma.
+      $type_exclude = str_replace("\r\n", ',', $type_exclude);
+      // Store into array.
+      $type_exclude = explode(',', $type_exclude);
 
-        if ($findings) {
-          $message = $this->t("This characters/words are not allowed to enter in the title - @findings", ['@findings' => implode(', ', $findings)]);
-          $this->context->addViolation($message);
-        }
+      $type_exclude = array_merge($type_exclude, $exclude_comma);
+
+      // Find any exclude value found in node title.
+      $findings = _node_title_validation_search_excludes_in_title($value_title, $type_exclude);
+
+      if ($findings) {
+        $message = $this->t("This characters/words are not allowed to enter in the title - @findings", ['@findings' => implode(', ', $findings)]);
+        $this->context->addViolation($message);
       }
     }
+
     $include_comma = [];
     foreach ($node_title_validation_config as $config_key => $config_value) {
       if ($config_value && $config_key == 'comma-' . $node_type) {
@@ -144,31 +171,26 @@ class NodeTitleConstraintValidator extends ConstraintValidator implements Contai
       }
       if ($config_key == 'unique-' . $node_type || $config_key == 'unique') {
         if ($config_value == 1) {
-          // Get existing node.
-          $nodes = $this->entityTypeManager
-            ->getStorage('node')
-            ->loadByProperties(['title' => $value_title, 'type' => $node_type]);
-
-          // Get existing node id.
-          $nid = $items[0]->getParent()->getEntity()->id();
-
-          // Check for nid.
-          if ($nid) {
-            // Check for node title by nid.
-            $node_title = \Drupal::entityTypeManager()->getStorage('node')->load($nid)->getTitle();
-
-            // Check for existing nid.
-            if ($node_title != $value_title && !empty($nodes)) {
-              $message = $this->t("There is already a node with the title - @value_title", ['@value_title' => $value_title]);
-              $this->context->addViolation($message);
+          $titleExists = FALSE;
+
+          // Get existing nodes with same title and type.
+          $nodes = $nodeStorage->loadByProperties([
+            'title' => $value_title,
+            'type' => $node_type,
+          ]);
+
+          if (!empty($nodes)) {
+            $titleExists = TRUE;
+            if (!$node->isNew() && $node->getTitle() === $value_title) {
+              // If title is the current node one, do not display error.
+              $titleExists = FALSE;
             }
           }
-          else {
-            // Check while adding a new node.
-            if (!empty($nodes)) {
-              $message = $this->t("There is already a node with the title - @value_title", ['@value_title' => $value_title]);
-              $this->context->addViolation($message);
-            }
+
+          // Show error.
+          if ($titleExists) {
+            $message = $this->t("There is already a node with the title - @title", ['@title' => $value_title]);
+            $this->context->addViolation($message);
           }
         }
       }
