diff --git a/src/ScriptManager.cpp b/src/ScriptManager.cpp
index ce142c3246dd221c53cb1e96e3f63740c55f6557..41450a4965dedea1d0fb11736eff49d9531a8520 100644
--- a/src/ScriptManager.cpp
+++ b/src/ScriptManager.cpp
@@ -108,17 +108,20 @@ void ScriptManager::preProcessFile(boost::filesystem::path& filePath)
 
     std::string result = exec(command.str());
 
-    if(result.find("PROCESS FATAL") != std::string::npos)
+    if(result.find("PROCESS OK") == std::string::npos)
     {
-        std::stringstream errorStream;
-        errorStream << "Pre process error: " << result;
-        throw std::runtime_error(errorStream.str());
-    }
-    else
-    {
-        std::stringstream errorStream;
-        errorStream << "Unknown pre process error: " << result;
-        throw std::runtime_error(errorStream.str());
+        if(result.find("PROCESS FATAL") != std::string::npos)
+        {
+            std::stringstream errorStream;
+            errorStream << "Pre process error: " << result;
+            throw std::runtime_error(errorStream.str());
+        }
+        else
+        {
+            std::stringstream errorStream;
+            errorStream << "Unknown pre process error: " << result;
+            throw std::runtime_error(errorStream.str());
+        }
     }
 }
 
diff --git a/src/WorkerThread.cpp b/src/WorkerThread.cpp
index a4d3720fa4a309e8783a4278a99d9f6e144ef013..a90a830d9a6bfa2ce4e593bf582217b783a13186 100644
--- a/src/WorkerThread.cpp
+++ b/src/WorkerThread.cpp
@@ -75,6 +75,8 @@ void WorkerThread::workerLoop()
                 }
                 while(boost::chrono::steady_clock::now()-start <= waitTime);
 
+                m_fileManager_sp->preProcessFile(origPath);
+
                 copyToDestination(origPath);
 
                 if(verified)