diff --git a/src/AlinkPostRenderer.php b/src/AlinkPostRenderer.php
index 78833d7..454aeda 100644
--- a/src/AlinkPostRenderer.php
+++ b/src/AlinkPostRenderer.php
@@ -116,33 +116,55 @@ class AlinkPostRenderer {
   public function replace() {
     $dom = Html::load($this->content);
     $xpath = new \DOMXPath($dom);
-
-    $this->existingLinks = $this->extractExistingLinks($xpath);
-    $this->keywords = array_filter($this->getKeywords(), function (Keyword $word) {
-      return !isset($this->existingLinks[$word->getUrl()]);
-    });
-
+    $flag = 0;
+    $this->keywords = $this->getKeywords();
+    $start = time();
     foreach ($xpath->query($this->xpathSelector) as $node) {
+      $map = new \Ds\Map();
       $text = $node->wholeText;
+      $string = htmlentities($text, null, 'utf-8');
+      $content = str_replace("&nbsp;", " ", $string);
+      $text = html_entity_decode($content);
+      $hashop = explode(' ',$text);
+      $start2 = time();
+      foreach($hashop as $wordd){
+        $wordd1 = preg_replace("/[^a-zA-Z]/","",$wordd);
+        $map->put($wordd1,1);
+      }
       $replace = FALSE;
       if (empty(trim($text))) {
         continue;
       }
       foreach ($this->keywords as $key => $word) {
-
-        // @TODO: Make it configurable replaceAll vs. replaceFirst
-        $text = $this->replaceFirst($word, '<a href="' . $word->getUrl() . '">' . $word->getText() . '</a>', $text, $count);
+        $flaged = 0;
+        $var= explode(' ',$word->getText());
+        foreach($var as $indiword){
+          if(!$map->haskey($indiword)){
+            if($indiword == "&"){
+              $flaged = 2;
+              continue;
+            }
+            $flaged = 1;
+            break;
+          }
+        }
+        if($flaged==0 || $flaged==2){
+        $key2 = microtime();
+        $text = $this->replaceFirst($word, '<a href="key' . $key2. 'key">' . 'key1'. $key2 .'key1'. '</a>', $text, $count);
+        $hashkey['key'. $key2. 'key'] = $word->getUrl();
+        $hashkey['key1'. $key2. 'key1'] = $word->getText();
         if ($count) {
           $replace = TRUE;
-          $this->addExistingLink($word);
-          break;
         }
+       }
       }
       if ($replace) {
-        $this->replaceNodeContent($node, $text);
-      }
+        foreach($hashkey as $key=>$value){
+          $text=str_replace($key,$value,$text);
+        }
+        $this->replaceNodeContent($node, $text);  
+      } 
     }
-
     return Html::serialize($dom);
   }
 
