diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
index f3cf262..2d1bc70 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
@@ -468,7 +468,29 @@
 
 	public static XrancPdu constructPacket(RRMConfig config) {
 		XrancPduBody body = new XrancPduBody();
-		body.setRRMConfig(config);
+        
+		XICICConfig xicicConfig = new XICICConfig();
+
+		xicicConfig.setCrnti(config.getCrnti().getCRNTI().get(0));
+		xicicConfig.setEcgi(config.getEcgi());
+
+		try {
+            xicicConfig.setEndPrbDl(config.getEndPrbDl().getSeqOf().get(0));
+        } catch (Exception ignored) {}
+
+        try {
+            xicicConfig.setEndPrbUl(config.getEndPrbUl().getSeqOf().get(0));
+        } catch (Exception ignored) {}
+
+        try {
+            xicicConfig.setStartPrbDl(config.getStartPrbDl().getSeqOf().get(0));
+        } catch (Exception ignored) {}
+
+        try {
+            xicicConfig.setEndPrbUl(config.getStartPrbUl().getSeqOf().get(0));
+        } catch (Exception ignored) {}
+
+        body.setXICICConfig(xicicConfig);
 
 		BerUTF8String ver = null;
 		try {
diff --git a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
index 1d9653d..ed7b0d2 100644
--- a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
+++ b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
@@ -107,6 +107,7 @@
     private LinkMap linkMap;
     /* MAPS */
     private ConcurrentMap<String, ECGI> legitCells = new ConcurrentHashMap<>();
+    private ConcurrentMap<CRNTI, UEContextUpdate> hoContextUpdateMap = new ConcurrentHashMap<>();
     private ConcurrentMap<CRNTI, SynchronousQueue<String>> hoQueue = new ConcurrentHashMap<>();
     private ConcurrentMap<ECGI, SynchronousQueue<String>> RRMCellQueue = new ConcurrentHashMap<>();
     private ConcurrentMap<CRNTI, SynchronousQueue<String>> scellAddQueue = new ConcurrentHashMap<>();
@@ -595,18 +596,23 @@
                     // Decode UE Admission Context Update.
                     UEContextUpdate ueContextUpdate = recv_pdu.getBody().getUEContextUpdate();
 
-                    RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
-
                     RnibUe ue = ueMap.get(ueContextUpdate.getMMEUES1APID());
-                    if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
-                        ue = new RnibUe();
+                    if (hoQueue.keySet().contains(ue.getRanId())) {
+                        CRNTI crnti = ueContextUpdate.getCrnti();
+                        hoContextUpdateMap.put(crnti, ueContextUpdate);
+                        hoQueue.remove(ue.getRanId());
+                    } else {
+                        RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
+                        if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
+                            ue = new RnibUe();
+                        }
+
+                        ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
+                        ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
+                        ue.setRanId(ueContextUpdate.getCrnti());
+
+                        hostAgent.addConnectedHost(ue, cell, ctx);
                     }
-
-                    ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
-                    ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
-                    ue.setRanId(ueContextUpdate.getCrnti());
-
-                    hostAgent.addConnectedHost(ue, cell, ctx);
                     break;
                 }
                 case 6: {
@@ -714,6 +720,20 @@
                         e.printStackTrace();
                     } finally {
                         hoQueue.remove(hoComplete.getCrntiNew());
+
+                        UEContextUpdate ueContextUpdate = hoContextUpdateMap.get(hoComplete.getCrntiNew());
+
+                        RnibUe ue = ueMap.get(ueContextUpdate.getMMEUES1APID());
+                        RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
+                        if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
+                            ue = new RnibUe();
+                        }
+
+                        ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
+                        ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
+                        ue.setRanId(ueContextUpdate.getCrnti());
+
+                        hostAgent.addConnectedHost(ue, cell, ctx);
                     }
                     break;
                 }
