w2v-server: activate last active tab after tabs are initialized
diff --git a/templates/index.html.ep b/templates/index.html.ep
index f4765a2..6fa4210 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -30,11 +30,6 @@
 					 return true;
 				 }});
 
-       if (localStorage) { // let's not crash if some user has IE7
-         var index = parseInt(localStorage['tab']||'0');
-			   $("#tabs").tabs({ active: index });
-       }
-
        $( "#tabs" ).on( "tabsactivate", function( event, ui ) {
          if (localStorage) localStorage['tab'] = ui.newTab.index();
        });
@@ -120,6 +115,11 @@
 						 cell.innerHTML = i+1;
 					 } );
 				 } ).draw();
+
+         if (localStorage) { // let's not crash if some user has IE7
+           var index = parseInt(localStorage['tab']||'0');
+			     $("#tabs").tabs({ active: index });
+         }
 			 }
 			 $("#tabs").css("visibility", "visible"); // now we can show the tabs
 
@@ -715,12 +715,6 @@
   													<%= ++$i %>.
 													</td>
 													% if($item) {
-														% if(!grep{$_ eq $item->{word}} @words) {
-															%   push @vecs, $item->{vector};
-															%   push @words, $item->{word};
-															%   push @ranks, $item->{rank};
-															%   push @marked, ($marked->{$item->{word}}? 1 : 0);
-														% }
 														<td align="right">
   														<%= sprintf("%.3f", $item->{dist}) %>
 														</td>