diff --git a/5_reconstruction/gtForwardSimulate_v2.m b/5_reconstruction/gtForwardSimulate_v2.m
index c69bad71d799663830fdca36536613c59ce63434..82d6cc6e284f9ccc008cd048883a4fef6131ee48 100644
--- a/5_reconstruction/gtForwardSimulate_v2.m
+++ b/5_reconstruction/gtForwardSimulate_v2.m
@@ -36,6 +36,11 @@ function out = gtForwardSimulate_v2(first, last, workingdirectory, phaseID, vara
 %     SUB-FUNCTIONS:
 %[sub]- sfGetRoi
 
+if isdeployed
+    global GT_DB
+    global GT_MATLAB_HOME
+    load('workspaceGlobal.mat');
+end
 
 cd(workingdirectory);
 gtDBConnect();
@@ -57,9 +62,6 @@ if ~exist('phaseID','var') || isempty(phaseID)
 end
 
 if isdeployed
-    global GT_DB
-    global GT_MATLAB_HOME
-    load('workspaceGlobal.mat');
     first   = str2double(first);
     last    = str2double(last);
     phaseID = str2double(phaseID);