diff --git a/full/Changes b/full/Changes
index 93798ca..252191b 100644
--- a/full/Changes
+++ b/full/Changes
@@ -1,6 +1,8 @@
 # version 0.61.2
 12/09/2018
-    - Added various log4j2 configurations.
+    - Added various log4j2 configurations (margaretha)
+13/09/2018
+    - Implemented VirtualCorpusRewrite (margaretha)
 
 # version 0.61.1
 28/08/2018
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/Initializator.java b/full/src/main/java/de/ids_mannheim/korap/config/Initializator.java
index 57d78b2..85360c7 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/Initializator.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/Initializator.java
@@ -5,6 +5,7 @@
 
 import org.springframework.beans.factory.annotation.Autowired;
 
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
 import de.ids_mannheim.korap.oauth2.dao.AccessScopeDao;
 import de.ids_mannheim.korap.util.QueryException;
@@ -25,7 +26,7 @@
 
     public Initializator () {}
 
-    public void init () throws IOException, QueryException {
+    public void init () throws IOException, QueryException, KustvaktException {
         setInitialAccessScope();
         loader.loadVCToCache();
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java b/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java
index ff303b1..4bee9be 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java
@@ -13,6 +13,12 @@
 import org.springframework.stereotype.Component;
 
 import de.ids_mannheim.korap.KrillCollection;
+import de.ids_mannheim.korap.constant.VirtualCorpusType;
+import de.ids_mannheim.korap.dao.VirtualCorpusDao;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.exceptions.StatusCodes;
+import de.ids_mannheim.korap.service.VirtualCorpusService;
+import de.ids_mannheim.korap.user.User.CorpusAccess;
 import de.ids_mannheim.korap.util.QueryException;
 import de.ids_mannheim.korap.web.SearchKrill;
 
@@ -22,10 +28,14 @@
     private FullConfiguration config;
     @Autowired
     private SearchKrill searchKrill;
-
+    @Autowired
+    private VirtualCorpusDao vcDao;
+    @Autowired
+    private VirtualCorpusService vcService;
+    
     private static Logger jlog = LogManager.getLogger(NamedVCLoader.class);
 
-    public void loadVCToCache () throws IOException, QueryException {
+    public void loadVCToCache () throws IOException, QueryException, KustvaktException {
 
         String dir = config.getNamedVCPath();
         File d = new File(dir);
@@ -66,18 +76,39 @@
                 continue;
             }
             jlog.debug(
-                    "READ " + file.getName() + " duration: " + (end - start));
+                    "READ " + filename + " duration: " + (end - start));
 
-            KrillCollection collection = new KrillCollection(json);
-            collection.setIndex(searchKrill.getIndex());
-
-            if (collection != null) {
-                collection.storeInCache(filename);
-            }
-            end = System.currentTimeMillis();
-            jlog.debug(filename + "caching duration: " + (end - start));
-            jlog.debug("memory cache: "
-                    + KrillCollection.cache.calculateInMemorySize());
+            cacheVC(json, filename);
+            storeVC(filename, json);
         }
     }
+    
+    private void cacheVC (String json, String filename) throws IOException, QueryException {
+        long start, end;
+        start = System.currentTimeMillis();
+        
+        KrillCollection collection = new KrillCollection(json);
+        collection.setIndex(searchKrill.getIndex());
+
+        if (collection != null) {
+            collection.storeInCache(filename);
+        }
+        end = System.currentTimeMillis();
+        jlog.info(filename + " caching duration: " + (end - start));
+        jlog.debug("memory cache: "
+                + KrillCollection.cache.calculateInMemorySize());
+    }
+
+    private void storeVC (String name, String koralQuery) throws KustvaktException {
+        if (!VirtualCorpusService.wordPattern.matcher(name).matches()) {
+            throw new KustvaktException(StatusCodes.INVALID_ARGUMENT,
+                    "Virtual corpus name must only contains letters, numbers, "
+                            + "underscores, hypens and spaces",
+                    name);
+        }
+        CorpusAccess requiredAccess = vcService.determineRequiredAccess(koralQuery);
+        vcDao.createVirtualCorpus(name, VirtualCorpusType.SYSTEM,
+                requiredAccess, koralQuery, null,
+                null, null, true, "system");
+    }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/VirtualCorpusDao.java b/full/src/main/java/de/ids_mannheim/korap/dao/VirtualCorpusDao.java
index 9e9983c..c8006aa 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dao/VirtualCorpusDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dao/VirtualCorpusDao.java
@@ -36,9 +36,10 @@
 import de.ids_mannheim.korap.user.User.CorpusAccess;
 import de.ids_mannheim.korap.utils.ParameterChecker;
 
-/** VirtualCorpusDao manages SQL queries regarding virtual corpora, 
- *  e.g. retrieving and storing virtual corpora.
- *  
+/**
+ * VirtualCorpusDao manages SQL queries regarding virtual corpora,
+ * e.g. retrieving and storing virtual corpora.
+ * 
  * @author margaretha
  *
  */
@@ -50,19 +51,20 @@
     private EntityManager entityManager;
 
     public int createVirtualCorpus (String name, VirtualCorpusType type,
-            CorpusAccess requiredAccess, String corpusQuery, String definition,
-            String description, String status, String createdBy)
-            throws KustvaktException {
+            CorpusAccess requiredAccess, String koralQuery, String definition,
+            String description, String status, boolean isCached,
+            String createdBy) throws KustvaktException {
 
         VirtualCorpus vc = new VirtualCorpus();
         vc.setName(name);
         vc.setType(type);
         vc.setRequiredAccess(requiredAccess);
-        vc.setCorpusQuery(corpusQuery);
+        vc.setKoralQuery(koralQuery);
         vc.setDefinition(definition);
         vc.setDescription(description);
         vc.setStatus(status);
         vc.setCreatedBy(createdBy);
+        vc.setCached(isCached);
 
         entityManager.persist(vc);
         return vc.getId();
@@ -70,7 +72,7 @@
 
     public void editVirtualCorpus (VirtualCorpus vc, String name,
             VirtualCorpusType type, CorpusAccess requiredAccess,
-            String corpusQuery, String definition, String description,
+            String koralQuery, String definition, String description,
             String status) throws KustvaktException {
 
         if (name != null && !name.isEmpty()) {
@@ -82,8 +84,8 @@
         if (requiredAccess != null) {
             vc.setRequiredAccess(requiredAccess);
         }
-        if (corpusQuery != null) {
-            vc.setCorpusQuery(corpusQuery);
+        if (koralQuery != null) {
+            vc.setKoralQuery(koralQuery);
         }
         if (definition != null && !definition.isEmpty()) {
             vc.setDefinition(definition);
@@ -97,22 +99,28 @@
         entityManager.merge(vc);
     }
 
-    public void deleteVirtualCorpus (VirtualCorpus vc) throws KustvaktException {
-        if (!entityManager.contains(vc)){
+    public void deleteVirtualCorpus (VirtualCorpus vc)
+            throws KustvaktException {
+        if (!entityManager.contains(vc)) {
             vc = entityManager.merge(vc);
         }
         entityManager.remove(vc);
-        
+
     }
 
-    /** System admin function. 
+    /**
+     * System admin function.
      * 
-     *  Retrieves virtual corpus by creator and type. If type is not specified, 
-     *  retrieves virtual corpora of all types. If createdBy is not specified,
-     *  retrieves virtual corpora of all users.
+     * Retrieves virtual corpus by creator and type. If type is not
+     * specified,
+     * retrieves virtual corpora of all types. If createdBy is not
+     * specified,
+     * retrieves virtual corpora of all users.
      * 
-     * @param type {@link VirtualCorpusType}
-     * @param createdBy username of the virtual corpus creator
+     * @param type
+     *            {@link VirtualCorpusType}
+     * @param createdBy
+     *            username of the virtual corpus creator
      * @return a list of {@link VirtualCorpus}
      * @throws KustvaktException
      */
@@ -172,6 +180,40 @@
         return vc;
     }
 
+    public VirtualCorpus retrieveVCByName (String vcName, String createdBy)
+            throws KustvaktException {
+        ParameterChecker.checkStringValue(createdBy, "createdBy");
+        ParameterChecker.checkStringValue(vcName, "vcName");
+
+        CriteriaBuilder builder = entityManager.getCriteriaBuilder();
+        CriteriaQuery<VirtualCorpus> query =
+                builder.createQuery(VirtualCorpus.class);
+
+        Root<VirtualCorpus> virtualCorpus = query.from(VirtualCorpus.class);
+
+        Predicate condition = builder.and(
+                builder.equal(virtualCorpus.get(VirtualCorpus_.createdBy),
+                        createdBy),
+                builder.equal(virtualCorpus.get(VirtualCorpus_.name), vcName));
+
+        query.select(virtualCorpus);
+        query.where(condition);
+
+        Query q = entityManager.createQuery(query);
+        VirtualCorpus vc = null;
+        try {
+            vc = (VirtualCorpus) q.getSingleResult();
+        }
+        catch (NoResultException e) {
+            String vcCode = createdBy + "/" + vcName;
+            throw new KustvaktException(StatusCodes.NO_RESULT_FOUND,
+                    "No result found for query: retrieve virtual corpus by name "
+                            + vcCode,
+                    String.valueOf(vcCode), e);
+        }
+        return vc;
+    }
+
     @SuppressWarnings("unchecked")
     public List<VirtualCorpus> retrieveOwnerVC (String userId)
             throws KustvaktException {
@@ -225,11 +267,11 @@
         Join<VirtualCorpus, VirtualCorpusAccess> access =
                 virtualCorpus.join(VirtualCorpus_.virtualCorpusAccess);
 
-        //        Predicate corpusStatus = builder.and(
-        //                builder.notEqual(access.get(VirtualCorpusAccess_.status),
-        //                        VirtualCorpusAccessStatus.HIDDEN),
-        //                builder.notEqual(access.get(VirtualCorpusAccess_.status),
-        //                        VirtualCorpusAccessStatus.DELETED));
+        // Predicate corpusStatus = builder.and(
+        // builder.notEqual(access.get(VirtualCorpusAccess_.status),
+        // VirtualCorpusAccessStatus.HIDDEN),
+        // builder.notEqual(access.get(VirtualCorpusAccess_.status),
+        // VirtualCorpusAccessStatus.DELETED));
 
         Predicate corpusStatus =
                 builder.notEqual(access.get(VirtualCorpusAccess_.status),
@@ -270,7 +312,6 @@
                 builder.equal(virtualCorpus.get(VirtualCorpus_.type),
                         VirtualCorpusType.SYSTEM));
 
-
         query.select(virtualCorpus);
         query.where(predicate);
         query.distinct(true);
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/converter/VirtualCorpusConverter.java b/full/src/main/java/de/ids_mannheim/korap/dto/converter/VirtualCorpusConverter.java
index 52cbfe6..9fec23d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/converter/VirtualCorpusConverter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/converter/VirtualCorpusConverter.java
@@ -31,7 +31,7 @@
         dto.setStatus(vc.getStatus());
         dto.setDescription(vc.getDescription());
         dto.setType(vc.getType().displayName());
-        dto.setKoralQuery(vc.getCorpusQuery());
+        dto.setKoralQuery(vc.getKoralQuery());
 
         JsonNode node = JsonUtils.readTree(statistics);
         int numberOfDoc = node.at("/documents").asInt();
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpus.java b/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpus.java
index 78f9fff..4a6aeeb 100644
--- a/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpus.java
+++ b/full/src/main/java/de/ids_mannheim/korap/entity/VirtualCorpus.java
@@ -48,10 +48,12 @@
     @Column(name = "required_access")
     private CorpusAccess requiredAccess;
     @Column(name = "corpus_query")
-    private String corpusQuery;
+    private String koralQuery;
     private String definition;
     @Column(name = "created_by")
     private String createdBy;
+    @Column(name = "is_cached")
+    private boolean isCached;
 
     @OneToMany(mappedBy = "virtualCorpus", fetch = FetchType.LAZY,
             cascade = CascadeType.REMOVE)
@@ -61,7 +63,7 @@
     public String toString () {
         return "id=" + id + ", name= " + name + ", type= " + type + ", status= "
                 + status + ", description=" + description + ", requiredAccess="
-                + requiredAccess + ", corpusQuery= " + corpusQuery
+                + requiredAccess + ", corpusQuery= " + koralQuery
                 + ", definition= " + definition + ", createdBy= " + createdBy;
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java
index 08c252f..091c1a8 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/CollectionRewrite.java
@@ -144,7 +144,7 @@
         KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
         RewriteIdentifier identifier = new KoralNode.RewriteIdentifier(
                 Attributes.AVAILABILITY, user.getCorpusAccess());
-        JsonNode rewrittesNode;
+        JsonNode rewrittenNode;
 
         if (jsonNode.has("collection")) {
             List<String> avalabilityCopy =
@@ -159,16 +159,16 @@
                 builder.with(buildAvailability(avalabilityCopy));
                 jlog.debug("corpus query: " + builder.toString());
                 builder.setBaseQuery(builder.toJSON());
-                rewrittesNode = builder.mergeWith(jsonNode).at("/collection");
-                node.set("collection", rewrittesNode, identifier);
+                rewrittenNode = builder.mergeWith(jsonNode).at("/collection");
+                node.set("collection", rewrittenNode, identifier);
             }
         }
         else {
             builder.with(buildAvailability(userAvailabilities));
             jlog.debug("corpus query: " + builder.toString());
-            rewrittesNode =
+            rewrittenNode =
                     JsonUtils.readTree(builder.toJSON()).at("/collection");
-            node.set("collection", rewrittesNode, identifier);
+            node.set("collection", rewrittenNode, identifier);
         }
 
         jlog.debug("REWRITES: " + node.at("/collection").toString());
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/FullRewriteHandler.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/FullRewriteHandler.java
index 0926a09..21bcc41 100644
--- a/full/src/main/java/de/ids_mannheim/korap/rewrite/FullRewriteHandler.java
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/FullRewriteHandler.java
@@ -1,26 +1,34 @@
 package de.ids_mannheim.korap.rewrite;
 
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
 import de.ids_mannheim.korap.config.FullConfiguration;
 import de.ids_mannheim.korap.resource.rewrite.CollectionCleanRewrite;
 import de.ids_mannheim.korap.resource.rewrite.DocMatchRewrite;
-//import de.ids_mannheim.korap.resource.rewrite.IdWriter;
+// import de.ids_mannheim.korap.resource.rewrite.IdWriter;
 import de.ids_mannheim.korap.resource.rewrite.RewriteHandler;
 
-/** Defines rewrite handling methods relevant only in full version. 
+/**
+ * Defines rewrite handling methods relevant only in full version.
  * 
  * @author margaretha
  *
  */
-public class FullRewriteHandler extends RewriteHandler{
+public class FullRewriteHandler extends RewriteHandler {
 
+    @Autowired
+    private VirtualCorpusRewrite vcRewrite;
+    
     public FullRewriteHandler (FullConfiguration config) {
         super(config);
     }
-    
+
     public void defaultRewriteConstraints () {
-      this.add(CollectionRewrite.class);
-//      this.add(IdWriter.class);
-      this.add(DocMatchRewrite.class);
-      this.add(CollectionCleanRewrite.class);
-  }
+        this.addProcessor(vcRewrite);
+        this.add(CollectionRewrite.class);
+        // this.add(IdWriter.class);
+        this.add(DocMatchRewrite.class);
+        this.add(CollectionCleanRewrite.class);
+    }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewrite.java b/full/src/main/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewrite.java
new file mode 100644
index 0000000..ef7ec7d
--- /dev/null
+++ b/full/src/main/java/de/ids_mannheim/korap/rewrite/VirtualCorpusRewrite.java
@@ -0,0 +1,72 @@
+package de.ids_mannheim.korap.rewrite;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.entity.VirtualCorpus;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.resource.rewrite.KoralNode;
+import de.ids_mannheim.korap.resource.rewrite.KoralNode.RewriteIdentifier;
+import de.ids_mannheim.korap.resource.rewrite.RewriteTask;
+import de.ids_mannheim.korap.service.VirtualCorpusService;
+import de.ids_mannheim.korap.user.User;
+import de.ids_mannheim.korap.utils.JsonUtils;
+
+@Component
+public class VirtualCorpusRewrite implements RewriteTask.RewriteQuery {
+
+    @Autowired
+    private VirtualCorpusService vcService;
+
+    @Override
+    public JsonNode rewriteQuery (KoralNode node, KustvaktConfiguration config,
+            User user) throws KustvaktException {
+        if (node.has("collection")) {
+            findVCRef(user.getUsername(), node.at("/collection"));
+        }
+        return node.rawNode();
+    }
+
+    private void findVCRef (String username, KoralNode koralNode)
+            throws KustvaktException {
+        if (koralNode.has("@type")
+                && koralNode.get("@type").equals("koral:docGroupRef")) {
+            if (!koralNode.has("ref")) {
+                // throw error
+            }
+            else {
+                String vcName = koralNode.get("ref");
+
+                VirtualCorpus vc =
+                        vcService.searchVCByName(username, vcName, "system");
+                if (!vc.isCached()) {
+                    String koralQuery = vc.getKoralQuery();
+                    JsonNode kq =
+                            JsonUtils.readTree(koralQuery).at("/collection");
+                    JsonNode jsonNode = koralNode.rawNode();
+                    // rewrite
+                    koralNode.remove("@type", new RewriteIdentifier("@type",
+                            jsonNode.at("/@type").asText()));
+                    koralNode.remove("ref", new RewriteIdentifier("ref",
+                            jsonNode.at("/ref").asText()));
+                    koralNode.setAll((ObjectNode) kq);
+                }
+            }
+
+        }
+        else if (koralNode.has("operands")) {
+            KoralNode operands = koralNode.at("/operands");
+
+            for (int i = 0; i < operands.size(); i++) {
+                KoralNode operand = operands.get(i);
+                findVCRef(username, operand);
+                operand.buildRewrites();
+            }
+
+        }
+    }
+}
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java b/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
index 27a9c97..33af77b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
@@ -55,7 +55,7 @@
     private static Logger jlog =
             LogManager.getLogger(VirtualCorpusService.class);
 
-    public static Pattern wordPattern = Pattern.compile("[\\w ]+");
+    public static Pattern wordPattern = Pattern.compile("[-\\w ]+");
 
     @Autowired
     private VirtualCorpusDao vcDao;
@@ -123,7 +123,7 @@
         Iterator<VirtualCorpus> i = vcList.iterator();
         while (i.hasNext()) {
             vc = i.next();
-            String json = vc.getCorpusQuery();
+            String json = vc.getKoralQuery();
             String statistics = krill.getStatistics(json);
             VirtualCorpusDto vcDto =
                     converter.createVirtualCorpusDto(vc, statistics);
@@ -234,7 +234,8 @@
         String name = vc.getName();
         if (!wordPattern.matcher(name).matches()) {
             throw new KustvaktException(StatusCodes.INVALID_ARGUMENT,
-                    "Virtual corpus name must only contains letters, numbers, underscores and spaces",
+                    "Virtual corpus name must only contains letters, numbers, "
+                            + "underscores, hypens and spaces",
                     name);
         }
 
@@ -249,7 +250,7 @@
 
         int vcId = vcDao.createVirtualCorpus(vc.getName(), vc.getType(),
                 requiredAccess, koralQuery, vc.getDefinition(),
-                vc.getDescription(), vc.getStatus(), username);
+                vc.getDescription(), vc.getStatus(), vc.isCached(), username);
 
         if (vc.getType().equals(VirtualCorpusType.PUBLISHED)) {
             publishVC(vcId);
@@ -274,7 +275,7 @@
         return koralQuery;
     }
 
-    private CorpusAccess determineRequiredAccess (String koralQuery)
+    public CorpusAccess determineRequiredAccess (String koralQuery)
             throws KustvaktException {
 
         if (findDocWithLicense(koralQuery, config.getAllOnlyRegex())) {
@@ -416,17 +417,32 @@
 
     }
 
+    public VirtualCorpus searchVCByName (String username, String vcName, String createdBy)
+            throws KustvaktException {
+        VirtualCorpus vc = vcDao.retrieveVCByName(vcName, createdBy);
+        checkVCAccess(vc, username);
+        return vc;
+    }
+
     public VirtualCorpusDto searchVCById (String username, int vcId)
             throws KustvaktException {
 
         VirtualCorpus vc = vcDao.retrieveVCById(vcId);
+        checkVCAccess(vc, username);
+        String json = vc.getKoralQuery();
+        String statistics = krill.getStatistics(json);
+        return converter.createVirtualCorpusDto(vc, statistics);
+    }
+
+    private void checkVCAccess (VirtualCorpus vc, String username)
+            throws KustvaktException {
         VirtualCorpusType type = vc.getType();
 
         if (!adminDao.isAdmin(username)
                 && !username.equals(vc.getCreatedBy())) {
             if (type.equals(VirtualCorpusType.PRIVATE)
                     || (type.equals(VirtualCorpusType.PROJECT)
-                            && !hasAccess(username, vcId))) {
+                            && !hasAccess(username, vc.getId()))) {
                 throw new KustvaktException(StatusCodes.AUTHORIZATION_FAILED,
                         "Unauthorized operation for user: " + username,
                         username);
@@ -434,8 +450,8 @@
 
             else if (VirtualCorpusType.PUBLISHED.equals(type)) {
                 // add user in the VC's auto group
-                UserGroup userGroup =
-                        userGroupService.retrieveHiddenUserGroupByVC(vcId);
+                UserGroup userGroup = userGroupService
+                        .retrieveHiddenUserGroupByVC(vc.getId());
                 try {
                     userGroupService.addGroupMember(username, userGroup,
                             "system", GroupMemberStatus.ACTIVE);
@@ -448,10 +464,6 @@
             }
             // else VirtualCorpusType.SYSTEM
         }
-
-        String json = vc.getCorpusQuery();
-        String statistics = krill.getStatistics(json);
-        return converter.createVirtualCorpusDto(vc, statistics);
     }
 
     private boolean hasAccess (String username, int vcId)
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/input/VirtualCorpusJson.java b/full/src/main/java/de/ids_mannheim/korap/web/input/VirtualCorpusJson.java
index a67876a..3d34d24 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/input/VirtualCorpusJson.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/input/VirtualCorpusJson.java
@@ -31,6 +31,7 @@
     private String definition;
     private String description;
     private String status;
+    private boolean isCached;
 
 
     public void setCorpusQuery (String corpusQuery)
diff --git a/full/src/main/resources/db/new-mysql/V1.1__create_virtual_corpus_tables.sql b/full/src/main/resources/db/new-mysql/V1.1__create_virtual_corpus_tables.sql
index 3b8022b..55f2163 100644
--- a/full/src/main/resources/db/new-mysql/V1.1__create_virtual_corpus_tables.sql
+++ b/full/src/main/resources/db/new-mysql/V1.1__create_virtual_corpus_tables.sql
@@ -63,6 +63,7 @@
   status varchar(100) DEFAULT NULL,
   corpus_query TEXT NOT NULL,
   definition varchar(255) DEFAULT NULL,
+  is_cached BOOLEAN DEFAULT 0,
   INDEX owner_index (created_by),
   INDEX type_index (type)
 );
diff --git a/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql b/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql
index 462e85a..56fc105 100644
--- a/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql
+++ b/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql
@@ -72,7 +72,8 @@
   description VARCHAR(255) DEFAULT NULL,
   status VARCHAR(100) DEFAULT NULL,
   corpus_query TEXT NOT NULL,
-  definition VARCHAR(255) DEFAULT NULL
+  definition VARCHAR(255) DEFAULT NULL,
+  is_cached BOOLEAN DEFAULT 0
 );
 
 CREATE INDEX virtual_corpus_owner_index ON virtual_corpus(created_by);
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/NamedVCLoaderTest.java b/full/src/test/java/de/ids_mannheim/korap/config/NamedVCLoaderTest.java
new file mode 100644
index 0000000..b5b218a
--- /dev/null
+++ b/full/src/test/java/de/ids_mannheim/korap/config/NamedVCLoaderTest.java
@@ -0,0 +1,35 @@
+package de.ids_mannheim.korap.config;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import de.ids_mannheim.korap.KrillCollection;
+import de.ids_mannheim.korap.collection.CachedVCData;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.util.QueryException;
+import net.sf.ehcache.Element;
+
+public class NamedVCLoaderTest extends SpringJerseyTest{
+
+    @Autowired
+    private NamedVCLoader vcLoader;
+    
+    
+    @Test
+    public void testNamedVCLoader () throws IOException, QueryException, KustvaktException {
+        Element element = KrillCollection.cache.get("named-vc1");
+        assertTrue(element==null);
+        
+        vcLoader.loadVCToCache();
+
+        element = KrillCollection.cache.get("named-vc1");
+        assertNotNull(element);
+        CachedVCData cachedData = (CachedVCData) element.getObjectValue();
+        assertTrue(cachedData.getDocIdMap().size() > 0);
+    }
+}
diff --git a/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java
index 40d4abd..1cdd7a5 100644
--- a/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/dao/UserGroupDaoTest.java
@@ -146,7 +146,7 @@
         String name = "dory new vc";
         int id = virtualCorpusDao.createVirtualCorpus(name,
                 VirtualCorpusType.PROJECT, CorpusAccess.PUB,
-                "corpusSigle=WPD15", "", "", "", createdBy);
+                "corpusSigle=WPD15", "", "", "", false, createdBy);
 
         VirtualCorpus virtualCorpus = virtualCorpusDao.retrieveVCById(id);
         userGroupDao.addVCToGroup(virtualCorpus, createdBy,
diff --git a/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java
index 3b97caa..e15a518 100644
--- a/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/dao/VirtualCorpusDaoTest.java
@@ -45,7 +45,7 @@
         // insert vc
         int id = dao.createVirtualCorpus("system VC", VirtualCorpusType.SYSTEM,
                 User.CorpusAccess.FREE, "corpusSigle=GOE", "definition",
-                "description", "experimental", "test class");
+                "description", "experimental", false, "test class");
 
         // select vc
         List<VirtualCorpus> vcList =
diff --git a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/VirtualCorpusRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/VirtualCorpusRewriteTest.java
new file mode 100644
index 0000000..a388ae1
--- /dev/null
+++ b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/VirtualCorpusRewriteTest.java
@@ -0,0 +1,62 @@
+package de.ids_mannheim.korap.resource.rewrite;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.net.HttpHeaders;
+import com.sun.jersey.api.client.ClientResponse;
+
+import de.ids_mannheim.korap.authentication.http.HttpAuthorizationHandler;
+import de.ids_mannheim.korap.config.Attributes;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.utils.JsonUtils;
+
+/**
+ * @author margaretha
+ *
+ */
+public class VirtualCorpusRewriteTest extends SpringJerseyTest {
+
+    @Test
+    public void testSearchFreeWithVCRef () throws KustvaktException {
+        ClientResponse response = resource().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"system VC\"")
+                .get(ClientResponse.class);
+
+        String ent = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(ent);
+        node = node.at("/collection");
+
+        assertEquals("koral:docGroup", node.at("/@type").asText());
+        assertEquals(3, node.at("/operands/1/rewrites").size());
+        node = node.at("/operands/1/rewrites");
+        assertEquals("operation:deletion", node.at("/0/operation").asText());
+        assertEquals("operation:deletion", node.at("/1/operation").asText());
+        assertEquals("operation:insertion", node.at("/2/operation").asText());
+    }
+
+    @Test
+    public void testSearchPubWithVCRef () throws KustvaktException {
+        ClientResponse response = resource().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("cq", "referTo \"system VC\"")
+                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
+                        .createBasicAuthorizationHeaderValue("user", "pass"))
+                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
+                .get(ClientResponse.class);
+
+        String ent = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(ent);
+        node = node.at("/collection");
+        assertEquals("koral:docGroup", node.at("/@type").asText());
+        assertEquals("koral:docGroup", node.at("/operands/0/@type").asText());
+        assertEquals(3, node.at("/operands/1/rewrites").size());
+        assertEquals("koral:doc", node.at("/operands/1/@type").asText());
+        assertEquals("GOE", node.at("/operands/1/value").asText());
+        assertEquals("corpusSigle", node.at("/operands/1/key").asText());
+    }
+}
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/VCReferenceTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/VCReferenceTest.java
index a7e2195..4ce02ff 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/VCReferenceTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/VCReferenceTest.java
@@ -1,8 +1,12 @@
 package de.ids_mannheim.korap.web.controller;
 
 import static org.junit.Assert.assertEquals;
+
 import static org.junit.Assert.assertTrue;
 
+import java.io.IOException;
+
+import org.junit.Ignore;
 import org.junit.Test;
 
 import com.fasterxml.jackson.databind.JsonNode;
@@ -10,14 +14,19 @@
 
 import de.ids_mannheim.korap.config.SpringJerseyTest;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.util.QueryException;
 import de.ids_mannheim.korap.utils.JsonUtils;
 
 public class VCReferenceTest extends SpringJerseyTest {
 
+    // auto caching is disabled in krill
+    @Ignore
     @Test
-    public void testVCRef () throws KustvaktException {
+    public void testVCRef ()
+            throws KustvaktException, IOException, QueryException {
         testSearchWithoutVCRefOr();
         testSearchWithoutVCRefAnd();
+
         // auto caching
         testStatisticsWithVCReference();
         testSearchWithVCRefNotEqual();
@@ -75,13 +84,12 @@
 
     public void testStatisticsWithVCReference () throws KustvaktException {
         String corpusQuery = "availability = /CC-BY.*/ & referTo named-vc1";
-        ClientResponse response = resource().path(API_VERSION).path("statistics")
-                .queryParam("corpusQuery", corpusQuery)
+        ClientResponse response = resource().path(API_VERSION)
+                .path("statistics").queryParam("corpusQuery", corpusQuery)
                 .get(ClientResponse.class);
 
         String ent = response.getEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertEquals(2, node.at("/documents").asInt());
     }
-
 }
