diff --git a/js/som.js b/js/som.js
index ca16d28..e496d36 100644
--- a/js/som.js
+++ b/js/som.js
@@ -135,7 +135,10 @@
 //  var avg, avgsim1, avgsim2, minsim;
   var refIndex;
   var colorScale;
-  
+  var urlprefix =  new URLSearchParams(window.location.search);
+  urlprefix.delete("word");
+  urlprefix.append("word","");
+
   if(no_targets > 1) {
     refIndex=1;
     colorScale = d3.scale.linear()
@@ -192,7 +195,7 @@
 			.enter().append("g")
 			.attr("class", "u");
 	g.append("a")
-	  .attr("xlink:href", function(word) {return data.urlprefix+word;})
+	  .attr("xlink:href", function(word) {return "?"+urlprefix+word;})
 	  .attr("title", function(d, i) {
 		  return "rank: "+i +"  "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
 	  })
diff --git a/templates/index.html.ep b/templates/index.html.ep
index 0a2a408..3f4de00 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -62,7 +62,6 @@
          }
 
          % use Mojo::ByteStream 'b';
-         % my $urlprefix = url_with->query([word=>'']);
          var paraResults = <%= b(Mojo::JSON::to_json($lists)) %>;
          var urlprefix =  new URLSearchParams(window.location.search);
          if (paraResults.length > 0  && paraResults[0] != null) {
@@ -76,7 +75,7 @@
                  nranks = nranks.concat(paraResults[i].map(function(a){return a.rank;}));
                  nmarked = nmarked.concat(paraResults[i].map(function(a){return a.marked;}));
              }
-             showMap({target: " "+urlParams.get('word')+" ", mergedEnd: 0, words: nwords, vecs: nvecs, ranks: nranks, marked: nmarked, urlprefix: "?"+urlprefix} );
+             showMap({target: " "+urlParams.get('word')+" ", mergedEnd: 0, words: nwords, vecs: nvecs, ranks: nranks, marked: nmarked} );
              var t = $('#firsttable').DataTable({
                  data: paraResults[0],
                  "sScrollY": "780px",
@@ -500,8 +499,8 @@
                 T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20;
                 T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20;
                 return "translate(" +
-                           (d.x) + "," +
-                           (d.y) + ")";
+                                (d.x) + "," +
+                                (d.y) + ")";
             });
      }
 
@@ -511,8 +510,8 @@
             .data(data.words)
             .attr("transform", function(d, i) {
                 return "translate(" +
-                            ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
-                            ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
+                                 ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
+                                 ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
      }
 
      var svg;
@@ -522,6 +521,9 @@
 
      function drawEmbedding() {
          var urlprefix =  new URLSearchParams(window.location.search);
+         urlprefix.delete("word");
+         urlprefix.append("word","");
+
          $("#embed").empty();
          var div = d3.select("#embed");
 
@@ -539,7 +541,7 @@
 
          g.append("a")
           .attr("xlink:href", function(word) {
-              urlprefix.set("word", word); return "?"+urlprefix; })
+              return "?"+urlprefix+word; })
           .attr("class", function(d, i) {
               var res="";
               if(data.marked[i]) {
@@ -616,12 +618,12 @@
 
          //  setTimeout(updateEmbedding, 1);
          //  setTimeout(
-             labeler =   d3.labeler()
-                           .label(labels)
-                           .anchor(anchor_array)
-                           .width(mapWidth)
-                           .height(mapHeight)
-                           .update(applyJitter);
+         labeler =   d3.labeler()
+                       .label(labels)
+                       .anchor(anchor_array)
+                       .width(mapWidth)
+                       .height(mapHeight)
+                       .update(applyJitter);
          //         .start(1000);
 
          iter_id = setInterval(jitterStep, 1);
