diff --git a/tools.descartes.prisma.agent.generic/src/tools/descartes/prisma/agent/generic/GenericAgent.java b/tools.descartes.prisma.agent.generic/src/tools/descartes/prisma/agent/generic/GenericAgent.java
index 7254464b51c1583a95993dd8bcaa834525598390..36ea4168966a73dc1fb417cb645837c6901288cd 100644
--- a/tools.descartes.prisma.agent.generic/src/tools/descartes/prisma/agent/generic/GenericAgent.java
+++ b/tools.descartes.prisma.agent.generic/src/tools/descartes/prisma/agent/generic/GenericAgent.java
@@ -14,10 +14,8 @@ import org.apache.commons.cli.GnuParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
 import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.common.util.TreeIterator;
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
 import org.eclipse.emf.ecore.EStructuralFeature.Setting;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -27,9 +25,6 @@ import org.eclipse.equinox.app.IApplication;
 import org.eclipse.equinox.app.IApplicationContext;
 
 import edu.kit.ipd.descartes.identifier.Identifier;
-import edu.kit.ipd.descartes.mm.resourcetype.ResourceType;
-import edu.kit.ipd.descartes.mm.resourcetype.ResourceTypeRepository;
-import edu.kit.ipd.descartes.mm.resourcetype.ResourcetypePackage;
 import tools.descartes.prisma.agent.generic.genericagent.GenericAgentConfiguration;
 import tools.descartes.prisma.agent.generic.genericagent.RequiredObject;
 import tools.descartes.prisma.core.ModelRepository;
@@ -143,8 +138,6 @@ public class GenericAgent implements IApplication {
 
 		agent.start().get();
 
-		replacePublicResources(agent, configuration.getSkeleton());
-
 		if (resolveRequiredObjects(agent, configuration)) {
 			agent.apply(configuration.getSkeleton());
 		}
@@ -178,36 +171,6 @@ public class GenericAgent implements IApplication {
 	}
 
 
-	private void replacePublicResources(GenericAgentController agent, ModelSkeleton skeleton) {
-		// Resource types (e.g., CPU, HDD, DELAY) which are defined globally are
-		// not included in the model skeleton.
-		// We need to find these references in the model skeleton and connect
-		// them with the instances in the repository.
-		TreeIterator<EObject> iterator = skeleton.eAllContents();
-		ResourceTypeRepository publicResourceTypes = agent.getContainerScope().getSystemScope().getResourceTypes();
-		while (iterator.hasNext()) {
-			EObject curObject = iterator.next();
-			for (EReference curReference : curObject.eClass().getEAllReferences()) {
-				if (!curReference.isContainment() && !curReference.isContainer()) {
-					if (ResourcetypePackage.Literals.RESOURCE_TYPE.isSuperTypeOf(curReference.getEReferenceType())) {
-						ResourceType curType = (ResourceType) curObject.eGet(curReference);
-						// find matching resources in system global scope
-						// (matching is based on name and class
-						for (ResourceType curPublicOne : publicResourceTypes.getResourceTypes()) {
-							if (curType.eClass().isInstance(curPublicOne)
-									&& curType.getName().equals(curPublicOne.getName())) {
-								ModelSkeletonAdapter adapter = agent.getModelRepository().adapt(curType,
-										ModelSkeletonAdapter.class);
-								adapter.setRepositoryObject(curPublicOne);
-								break;
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-
 	private boolean resolveRequiredObjects(GenericAgentController agent, GenericAgentConfiguration configuration) {
 		Set<RequiredObject> notResolved = new HashSet<>(configuration.getRequiredObjects());
 		for (EObject curDelegate : agent.getDelegatedObjects()) {
diff --git a/tools.descartes.prisma.core/src/tools/descartes/prisma/core/agent/AgentController.java b/tools.descartes.prisma.core/src/tools/descartes/prisma/core/agent/AgentController.java
index 8fa6727117a58d8d79a6e00aa004a146ded3b4fa..d6a81f0fb94a088ecb76f0636a6584473b8e8be9 100644
--- a/tools.descartes.prisma.core/src/tools/descartes/prisma/core/agent/AgentController.java
+++ b/tools.descartes.prisma.core/src/tools/descartes/prisma/core/agent/AgentController.java
@@ -13,8 +13,13 @@ import java.util.concurrent.TimeUnit;
 import org.eclipse.emf.cdo.CDOAdapter;
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.TreeIterator;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
 
+import edu.kit.ipd.descartes.mm.resourcetype.ResourceType;
+import edu.kit.ipd.descartes.mm.resourcetype.ResourceTypeRepository;
+import edu.kit.ipd.descartes.mm.resourcetype.ResourcetypePackage;
 import tools.descartes.prisma.core.ModelRepository;
 import tools.descartes.prisma.core.Transaction;
 import tools.descartes.prisma.core.adapter.ModelSkeletonAdapter;
@@ -143,6 +148,9 @@ public class AgentController {
 
 	public void apply(ModelSkeleton skeleton) {
 		try (Transaction transaction = getModelRepository().createTransaction()) {
+
+			replacePublicResources(skeleton);
+
 			scope.synchronizeModelSkeleton(transaction, skeleton);
 
 			boolean success = true;
@@ -227,4 +235,34 @@ public class AgentController {
 			throw new IllegalStateException("The agent is not running.");
 		}
 	}
+
+	private void replacePublicResources(ModelSkeleton skeleton) {
+		// Resource types (e.g., CPU, HDD, DELAY) which are defined globally are
+		// not included in the model skeleton.
+		// We need to find these references in the model skeleton and connect
+		// them with the instances in the repository.
+		TreeIterator<EObject> iterator = skeleton.eAllContents();
+		ResourceTypeRepository publicResourceTypes = scope.getSystemScope().getResourceTypes();
+		while (iterator.hasNext()) {
+			EObject curObject = iterator.next();
+			for (EReference curReference : curObject.eClass().getEAllReferences()) {
+				if (!curReference.isContainment() && !curReference.isContainer()) {
+					if (ResourcetypePackage.Literals.RESOURCE_TYPE.isSuperTypeOf(curReference.getEReferenceType())) {
+						ResourceType curType = (ResourceType) curObject.eGet(curReference);
+						// find matching resources in system global scope
+						// (matching is based on name and class
+						for (ResourceType curPublicOne : publicResourceTypes.getResourceTypes()) {
+							if (curType.eClass().isInstance(curPublicOne)
+									&& curType.getName().equals(curPublicOne.getName())) {
+								ModelSkeletonAdapter adapter = getModelRepository().adapt(curType,
+										ModelSkeletonAdapter.class);
+								adapter.setRepositoryObject(curPublicOne);
+								break;
+							}
+						}
+					}
+				}
+			}
+		}
+	}
 }