diff --git a/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java b/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java
index 1c35233..5b1bff7 100644
--- a/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/collection/CachedVCFilter.java
@@ -2,6 +2,8 @@
 
 import java.io.IOException;
 
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.search.DocIdSet;
 import org.apache.lucene.search.Filter;
@@ -15,11 +17,13 @@
  */
 public class CachedVCFilter extends Filter {
 
+    public static Logger jlog = LogManager.getLogger(CachedVCFilter.class);
+
     private CachedVCData cachedCollection;
-	private String cacheKey;
+    private String cacheKey;
 
     public CachedVCFilter (String cacheKey, CachedVCData cachedCollection) {
-		this.cacheKey = cacheKey;
+        this.cacheKey = cacheKey;
         this.cachedCollection = cachedCollection;
     }
 
@@ -30,14 +34,14 @@
                 cachedCollection.getDocIdMap().get(context.hashCode());
 
         if (docBits == null) {
-            // does not exist in the cache
+            jlog.debug("LeafReaderContext is not found in the cache.");
             return null;
         }
         return docBits.createBitDocIdSet();
     }
 
-	@Override
+    @Override
     public String toString () {
-		return "referTo(cached:" + this.cacheKey + ")";
+        return "referTo(cached:" + this.cacheKey + ")";
     };
 }
diff --git a/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java b/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java
index feba2d1..10f4645 100644
--- a/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java
@@ -287,7 +287,9 @@
 
         public Filter toFilter () throws QueryException {
 			Element element = KrillCollection.cache.get(this.reference);
+			
             if (element == null) {
+                log.debug(reference + " is NOT found in the cache");
                 KrillCollection kc = new KrillCollection();
 
 				kc.fromStore(this.reference);
@@ -307,6 +309,7 @@
 					);
 			}
             else {
+                log.debug(reference + " is FOUND in the cache.");
                 CachedVCData cc = (CachedVCData) element.getObjectValue();
                 return new CachedVCFilter(this.reference, cc);
             }
diff --git a/src/main/java/de/ids_mannheim/korap/collection/ToCacheVCFilter.java b/src/main/java/de/ids_mannheim/korap/collection/ToCacheVCFilter.java
index fe2c437..3a3675d 100644
--- a/src/main/java/de/ids_mannheim/korap/collection/ToCacheVCFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/collection/ToCacheVCFilter.java
@@ -10,12 +10,15 @@
 import org.apache.lucene.search.Filter;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.FixedBitSet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import de.ids_mannheim.korap.KrillCollection;
 import de.ids_mannheim.korap.collection.CollectionBuilder.Interface;
 import net.sf.ehcache.Element;
 
-/** Filter for virtual corpus / collection that should be cached.  
+/**
+ * Filter for virtual corpus / collection that should be cached.
  * 
  * @author margaretha
  *
@@ -25,7 +28,11 @@
     private CollectionBuilder.Interface cbi;
     private String cacheKey;
     private Map<Integer, DocBits> docIdMap;
+    // EM: auto caching is disabled regarding issue #44 
+    private boolean isAutoCachingEnabled = false;
 
+    public final static Logger log = LoggerFactory.getLogger(ToCacheVCFilter.class);
+            
     public ToCacheVCFilter (String cacheKey, Map<Integer, DocBits> docIdMap,
                             Interface cbi, Filter filter) {
         this.cacheKey = cacheKey;
@@ -54,22 +61,27 @@
         }
         else {
             bitset.or(docIdSet.iterator());
-            if (cbi.isNegative()){
+            if (cbi.isNegative()) {
                 bitset.flip(0, maxDoc);
             }
         }
 
-        docIdMap.put(context.hashCode(), new DocBits(bitset.getBits(), bitset.length()));
-        CachedVCData cachedVCData = new CachedVCData(new HashMap<>(docIdMap));
+        if (isAutoCachingEnabled) {
+            docIdMap.put(context.hashCode(),
+                    new DocBits(bitset.getBits(), bitset.length()));
+            CachedVCData cachedVCData =
+                    new CachedVCData(new HashMap<>(docIdMap));
 
-        KrillCollection.cache.remove(cacheKey);
-        KrillCollection.cache.put(new Element(cacheKey, cachedVCData));
+            KrillCollection.cache.remove(cacheKey);
+            KrillCollection.cache.put(new Element(cacheKey, cachedVCData));
+        }
 
+        log.debug("To cache doc bits length: "+ docIdSet.bits().length());
         return docIdSet;
     }
 
     @Override
     public String toString () {
-		return "referTo(" + this.cacheKey + ")";
+        return "referTo(" + this.cacheKey + ")";
     };
 }
