diff --git a/dev/js/spec/statSpec.js b/dev/js/spec/statSpec.js
index f0e4b8b..864a8ca 100644
--- a/dev/js/spec/statSpec.js
+++ b/dev/js/spec/statSpec.js
@@ -130,7 +130,7 @@
   checkStatActive = function(view, div){   
     // corpus statistic exists, it is active and reloadStatButton is shown
     if ((view.firstChild.classList.contains("stattable") === true) 
-      && (view.firstChild.classList.contains("greyOut") === false)
+      && (view.firstChild.classList.contains("stdisabled") === false)
       && (div.getElementsByClassName("reloadStatB").length == 0) ) { 
       return true;
     } 
@@ -143,7 +143,7 @@
    */
   checkStatDisabled = function(view, div){
     if ((view.firstChild.classList.contains("stattable") === true) 
-        && (view.firstChild.classList.contains("greyOut") === true)
+        && (view.firstChild.classList.contains("stdisabled") === true)
         && (div.getElementsByClassName("reloadStatB").length === 1) ) {
       return true;
     }   
@@ -318,7 +318,11 @@
      * in vc builder through user-interaction
      */
 	describe ('KorAP.CorpusStat.Disable', function(){
-	
+	  
+	  document.addEventListener('vcChange', function (e) {
+        KorAP.vc.checkStatActive(e.detail);
+        }, false);
+	    
 	  /**
 	   * If the user defines a new vc, the statistic should be disabled,
 	   * because it is out-of-date.
diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index 34a838a..d94b1b5 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -90,6 +90,10 @@
     var input = d.getElementById('collection');
 
     var vc = KorAP.vc;
+    
+    document.addEventListener('vcChange', function (e) {
+      vc.checkStatActive(e.detail);
+      }, false);
 
     // Add vc name object
     if (input) {
diff --git a/dev/js/src/vc.js b/dev/js/src/vc.js
index af09132..4bc5e13 100644
--- a/dev/js/src/vc.js
+++ b/dev/js/src/vc.js
@@ -367,7 +367,9 @@
      */    
     update : function() {
       this._root.update();
-      this.checkGrayingStat();
+      var vcchevent = new CustomEvent('vcChange', {'detail':this});
+      document.dispatchEvent(vcchevent);
+      
       return this;
     },
     /**
@@ -485,12 +487,12 @@
     },
     
     /**
-     * Checks if corpus statistic has to be greyOut,
+     * Checks if corpus statistic has to be disabled,
      * and to be updated after clicking at the "reload-button"
      */
-    checkGrayingStat : function(){
+    checkStatActive : function(){
       if(this.panel !== undefined && this.panel.statView !==undefined){
-        this.panel.statView.checkGrayingStatistic();
+        this.panel.statView.checkStatActive();
       }
     }
   };
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index 2a0e872..132c4a8 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -150,7 +150,10 @@
       };
       
       if(KorAP.vc){
-        KorAP.vc.checkGrayingStat();
+      //Replaced through Event
+      //KorAP.vc.checkGrayingStat(this); 
+      var vcchevent = new CustomEvent('vcChange', {'detail':this});
+      document.dispatchEvent(vcchevent);
       }
       
       return e;
diff --git a/dev/js/src/vc/docgroupref.js b/dev/js/src/vc/docgroupref.js
index fa82a4b..3b7bd6d 100644
--- a/dev/js/src/vc/docgroupref.js
+++ b/dev/js/src/vc/docgroupref.js
@@ -109,7 +109,10 @@
         // Append new operators
         e.appendChild(op.element());
       };  
-      KorAP.vc.checkGrayingStat();
+
+      var vcchevent = new CustomEvent('vcChange', {'detail':this});
+      document.dispatchEvent(vcchevent);
+      
       return this.element();
     },
 
diff --git a/dev/js/src/view/corpstatv.js b/dev/js/src/view/corpstatv.js
index 8e7b965..a566287 100644
--- a/dev/js/src/view/corpstatv.js
+++ b/dev/js/src/view/corpstatv.js
@@ -105,9 +105,9 @@
 
     
     /**
-     * Checks if graying necessary
+     * Checks if statistic has to be disabled
      */
-    checkGrayingStatistic : function (){
+    checkStatActive : function (){
      var newString = KorAP.vc.toQuery();
      var oldString = this.vc.oldvcQuery;
      /*
@@ -123,17 +123,17 @@
          newString = newString.slice(1, newString.length-1);
        }
        if(newString != oldString) {
-        this.grayingStat();
+        this.disableStat();
       }  
      }
      
    },
    
     /**
-     * Graying corpus statistic if in vc builder a different vc is choosen.
+     * Disabling corpus statistic if in vc builder a different vc is choosen.
      * After clicking at the reload-button the up-to-date corpus statistic is displayed.
      */   
-    grayingStat : function(){
+    disableStat : function(){
       var statt = this._show;
       
       if(statt.getElementsByClassName('reloadStatB').length == 0){
@@ -145,15 +145,15 @@
           var that = this;
           
           reloadb.addEventListener("click", function (e){    
-          statt.classList.remove('greyOut');
-          that.panel.actions.element().querySelector(".statistic").classList.remove('greyOut');
+          statt.classList.remove('stdisabled');
+          that.panel.actions.element().querySelector(".statistic").classList.remove('stdisabled');
           that.panel.reloadCorpStat(); 
              });
           
  
         statt.appendChild(reloadspan);
-        statt.classList.add('greyOut');        
-        this.panel.actions.element().querySelector(".statistic").classList.add('greyOut');
+        statt.classList.add('stdisabled');        
+        this.panel.actions.element().querySelector(".statistic").classList.add('stdisabled');
         
         console.log("Corpus statistic DISABLED");
         }
