anchor.diff:          'HOM': 'homozygote'
       }
       var allData = JSON.parse('${allData}');
  +    var url_string = window.location.href;
  +    var url = new URL(url_string);
  +    var stage = url.searchParams.get("dataLifeStage");
  +    var searchValue = url.searchParams.get("dataSearch");
  +
       ///$(document).ready(function () {
  -        allData.forEach(function (row) {
  -            row.evidence_link = buildLink(row);
  +    allData.forEach(function (row) {
  +        row.evidence_link = buildLink(row);
  +    });
  +
  +    $('#allDataTableCount').html(${rows});
  +    if (firstDTLoad) {
  +        $("#strainPvalues").bootstrapTable({
  +            data: allData,
  +            onSearch: function (event) {
  +                var searchText = event == '' ? null : event;
  +                $('#allDataTableCount').html($("#strainPvalues").bootstrapTable('getData').length);
  +                if (searchText != searchValue) {
  +                    console.log("I'm here");
  +                    window.history.replaceState('', '', updateURLParameter(window.location.href, 'dataSearch', searchText));
  +                }
  +            },
  +            onClickRow: function (row) {
  +                if (row.evidence_link) window.open(row.evidence_link);
  +            }
           });
  -
  -        $('#allDataTableCount').html(${rows});
  -        if (firstDTLoad) {
  -            $("#strainPvalues").bootstrapTable({
  -                data: allData,
  -                onSearch: function (event) {
  -                    var searchText = event == '' ? null : event;
  -                    $('#allDataTableCount').html($("#strainPvalues").bootstrapTable('getData').length);
  -                    window.history.replaceState('', '', updateURLParameter(window.location.href, 'dataSearch', event));
  -                },
  -                onClickRow: function (row) {
  -                    if (row.evidence_link) window.open(row.evidence_link);
  +        firstDTLoad = false;
  +    }
  +    $("#stage-selector :input").change(function () {
  +            var option = this.id;
  +            var selectedLifeStage = '';
  +            if (option != 'all') {
  +                if (option != 'embryo') {
  +                    $("#strainPvalues").bootstrapTable('filterBy', {life_stage: optionToLifeStage[option]}, {'filterAlgorithm': 'and'});
  +                } else {
  +                    $("#strainPvalues").bootstrapTable('filterBy', {life_stage: 'embryo'}, {
  +                        'filterAlgorithm': function (row, filters) {
  +                            return !!row.life_stage.match(/E\d+\.\d+/);
  +                        }
  +                    });
                   }
  -            });
  -            firstDTLoad = false;
  -        }
  -        $("#stage-selector :input").change(function () {
  -                var option = this.id;
  -                var selectedLifeStage = '';
  -                if (option != 'all') {
  -                    if (option != 'embryo') {
  -                        $("#strainPvalues").bootstrapTable('filterBy', {life_stage: optionToLifeStage[option]}, {'filterAlgorithm': 'and'});
  -                    } else {
  -                        $("#strainPvalues").bootstrapTable('filterBy', {life_stage: 'embryo'}, {
  -                            'filterAlgorithm': function (row, filters) {
  -                                return !!row.life_stage.match(/E\d+\.\d+/);
  -                            }
  -                        });
  -                    }
  -                } else {
  -                    $("#strainPvalues").bootstrapTable('filterBy', {}, {'filterAlgorithm': 'and'});
  -                }
  -                $('#allDataTableCount').html($("#strainPvalues").bootstrapTable('getData').length);
  +            } else {
  +                $("#strainPvalues").bootstrapTable('filterBy', {}, {'filterAlgorithm': 'and'});
  +            }
  +            $('#allDataTableCount').html($("#strainPvalues").bootstrapTable('getData').length);
  +            if (option != stage) {
  +                console.log("I'm here");
                   window.history.replaceState('', '', updateURLParameter(window.location.href, 'dataLifeStage', option));
               }
  -        );
  -
  -        var url_string = window.location.href;
  -        var url = new URL(url_string);
  -        var stage = url.searchParams.get("dataLifeStage");
  -        if (stage) $('#' + stage).click();
  -
  -        var searchValue = url.searchParams.get("dataSearch");
  -        if (searchValue) {
  -            $("#strainPvalues").bootstrapTable('resetSearch', searchValue);
  -        }
  +        }
  +    );
  +    if (stage) $('#' + stage).click();
  +    if (searchValue) {
  +        $("#strainPvalues").bootstrapTable('resetSearch', searchValue);
  +    }
   
   
       //});
  
positive.code:     function buildLink(row) {
          var baseUrl = "${baseUrl}";
          var link = null;
          if(row.procedure_name.startsWith("Viability Primary Screen") && row.parameter_stable_id !== "IMPC_VIA_001_001") {
              link = null;
          }
          else if(row.procedure_name.startsWith("Histopathology")) {
              link = baseUrl + '/histopath/' + row.gene_accession_id;
  
              if(row.phenotype_term) {
                  var term = row.phenotype_term.split('-')[0];
                  link = link + '?anatomy="' + term + '"';
              }
          } else if(row.procedure_name.startsWith("Gross Pathology and Tissue Collectio")) {
              link = baseUrl + '/grosspath/' + row.gene_accession_id + '/' + row.parameter_stable_id;
          } else {
              link =  baseUrl + "/charts?accession=" + row.gene_accession_id;
              link += "&allele_accession_id=" + row.allele_accession_id;
              link += "&parameter_stable_id=" + row.parameter_stable_id;
              if(zygosityMap[row.zygosity]) {
                  link += "&zygosity=" + zygosityMap[row.zygosity];
              }
              link += "&phenotyping_center=" + row.phenotyping_center;
  
negative.code:         var temp = "";
          if (additionalURL) {
              tempArray = additionalURL.split("&");
              for (var i = 0; i < tempArray.length; i++) {
                  if (tempArray[i].split('=')[0] != param) {
                      newAdditionalURL += temp + tempArray[i];
                      temp = "&";
                  }
  