diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/FoundryInject.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/FoundryInject.java
index e4a8e4b..56ff658 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/FoundryInject.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/FoundryInject.java
@@ -1,9 +1,13 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
 import com.fasterxml.jackson.databind.JsonNode;
+import de.ids_mannheim.korap.config.BeanConfiguration;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.handlers.UserSettingsDao;
 import de.ids_mannheim.korap.resource.LayerMapper;
 import de.ids_mannheim.korap.user.User;
+import de.ids_mannheim.korap.user.UserSettings;
 
 /**
  * @author hanl
@@ -11,15 +15,17 @@
  */
 public class FoundryInject implements RewriteTask.IterableRewriteAt {
 
-
     @Override
     public JsonNode preProcess(KoralNode node, KustvaktConfiguration config,
-            User user) {
+            User user) throws KustvaktException {
         LayerMapper mapper;
         // inject user settings from cache!
-        if (user != null)
-            mapper = new LayerMapper(config, null);
-        else
+        if (user != null && BeanConfiguration.hasContext()) {
+            UserSettingsDao dao = new UserSettingsDao(
+                    BeanConfiguration.getBeans().getPersistenceClient());
+            UserSettings settings = dao.get(user);
+            mapper = new LayerMapper(config, settings);
+        }else
             mapper = new LayerMapper(config);
 
         if (node.get("@type").equals("koral:term") && !node.has("foundry")) {
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
index c1fefa0..b6f7785 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
@@ -2,6 +2,7 @@
 
 import com.fasterxml.jackson.databind.JsonNode;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import org.slf4j.Logger;
@@ -167,13 +168,19 @@
                     continue;
                 }
             }
-
-            if (!post && task instanceof RewriteTask.RewriteBefore)
-                ((RewriteTask.RewriteBefore) task)
-                        .preProcess(node, this.config, user);
-            else if (task instanceof RewriteTask.RewriteAfter)
-                ((RewriteTask.RewriteAfter) task).postProcess(node);
-
+            try {
+                if (!post && task instanceof RewriteTask.RewriteBefore) {
+                    ((RewriteTask.RewriteBefore) task)
+                            .preProcess(node, this.config, user);
+                }else if (task instanceof RewriteTask.RewriteAfter) {
+                    ((RewriteTask.RewriteAfter) task).postProcess(node);
+                }
+            }catch (KustvaktException e) {
+                jlog.error("Error in rewrite processor {} for node {}",
+                        task.getClass().getSimpleName(),
+                        node.rawNode().toString());
+                e.printStackTrace();
+            }
             if (node.isRemove())
                 break;
         }
@@ -189,14 +196,19 @@
                 if ((rwa.at() != null && !node.at(rwa.at()).isMissingNode()))
                     next = node.at(rwa.at());
             }
-
-            if (!post && task instanceof RewriteTask.RewriteBefore)
-                ((RewriteTask.RewriteBefore) task)
-                        .preProcess(KoralNode.wrapNode(next), this.config,
-                                user);
-            else
-                ((RewriteTask.RewriteAfter) task)
-                        .postProcess(KoralNode.wrapNode(next));
+            try {
+                if (!post && task instanceof RewriteTask.RewriteBefore)
+                    ((RewriteTask.RewriteBefore) task)
+                            .preProcess(KoralNode.wrapNode(next), this.config,
+                                    user);
+                else
+                    ((RewriteTask.RewriteAfter) task)
+                            .postProcess(KoralNode.wrapNode(next));
+            }catch (KustvaktException e) {
+                jlog.error("Error in rewrite processor {} for node {}",
+                        task.getClass().getSimpleName(), node.toString());
+                e.printStackTrace();
+            }
         }
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteTask.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteTask.java
index 47b65ae..8166961 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteTask.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteTask.java
@@ -2,6 +2,7 @@
 
 import com.fasterxml.jackson.databind.JsonNode;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.user.User;
 
 /**
@@ -18,7 +19,7 @@
          * @return
          */
         JsonNode preProcess(KoralNode node, KustvaktConfiguration config,
-                User user);
+                User user) throws KustvaktException;
     }
 
     /**
@@ -27,7 +28,7 @@
      * after {@link de.ids_mannheim.korap.resource.rewrite.RewriteTask.IterableRewriteAt} have been processed
      */
     interface RewriteAfter extends RewriteTask {
-        JsonNode postProcess(KoralNode node);
+        JsonNode postProcess(KoralNode node) throws KustvaktException;
     }
 
     /**
diff --git a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
index 6ddfe1b..ae35e02 100644
--- a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
+++ b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
@@ -43,6 +43,9 @@
             m.put(Attributes.LASTNAME, "user");
             m.put(Attributes.EMAIL, "test@ids-mannheim.de");
             m.put(Attributes.ADDRESS, "Mannheim");
+            m.put(Attributes.DEFAULT_LEMMA_FOUNDRY, "test_l");
+            m.put(Attributes.DEFAULT_POS_FOUNDRY, "test_p");
+            m.put(Attributes.DEFAULT_CONST_FOUNDRY, "test_const");
 
             Assert.assertNotNull("userdatabase handler must not be null", dao);
 
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
index d8638f6..eff4638 100644
--- a/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
@@ -1,7 +1,11 @@
 package de.ids_mannheim.korap.resource.rewrite;
 
+import com.fasterxml.jackson.databind.JsonNode;
 import de.ids_mannheim.korap.config.BeanConfiguration;
-import org.junit.AfterClass;
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.config.TestHelper;
+import de.ids_mannheim.korap.query.serialize.QuerySerializer;
+import de.ids_mannheim.korap.utils.JsonUtils;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -13,7 +17,14 @@
 
     @BeforeClass
     public static void setup() {
-        BeanConfiguration.loadClasspathContext();
+        BeanConfiguration.loadClasspathContext("default-config.xml");
+        TestHelper.setupAccount();
+    }
+
+    //    @AfterClass
+    public static void close() {
+        TestHelper.dropUser();
+        BeanConfiguration.closeApplication();
     }
 
     @Test
@@ -23,17 +34,42 @@
     }
 
     @Test
-    public void testRewriteTastAdd() {
+    public void testRewriteTaskAdd() {
         RewriteHandler handler = new RewriteHandler(null);
-        handler.add(FoundryInject.class);
-        handler.add(DocMatchRewrite.class);
-        handler.add(CollectionCleanupFilter.class);
-        handler.add(IdWriter.class);
+        assert handler.add(FoundryInject.class);
+        assert handler.add(DocMatchRewrite.class);
+        assert handler.add(CollectionCleanupFilter.class);
+        assert handler.add(IdWriter.class);
     }
 
-    @AfterClass
-    public static void close() {
-        BeanConfiguration.closeApplication();
+    @Test
+    public void testRewriteFoundryInjectLemma() {
+        KustvaktConfiguration c = BeanConfiguration.getBeans()
+                .getConfiguration();
+        RewriteHandler handler = new RewriteHandler(c);
+        handler.add(FoundryInject.class);
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery("[base=Haus]", "poliqarp");
+        String result = handler.preProcess(s.toJSON(), TestHelper.getUser());
+        JsonNode node = JsonUtils.readTree(result);
+        assert node != null;
+        assert node.at("/query/wrap/layer").asText().equals("lemma");
+        assert node.at("/query/wrap/foundry").asText().equals("test_l");
+    }
+
+    @Test
+    public void testRewriteFoundryInjectPOS() {
+        KustvaktConfiguration c = BeanConfiguration.getBeans()
+                .getConfiguration();
+        RewriteHandler handler = new RewriteHandler(c);
+        handler.add(FoundryInject.class);
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery("[pos=ADJA]", "poliqarp");
+        String result = handler.preProcess(s.toJSON(), TestHelper.getUser());
+        JsonNode node = JsonUtils.readTree(result);
+        assert node != null;
+        assert node.at("/query/wrap/layer").asText().equals("pos");
+        assert node.at("/query/wrap/foundry").asText().equals("test_p");
     }
 
 }
