diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c
index fb4fd6553bc44f0699adc71a273b470e1170192d..a7c79a70d5537d341bfe6d3b82a613e8e7ac6000 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler.c
@@ -413,15 +413,16 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id,
       mac_eNB_rrc_ul_failure(module_idP, CC_id, frameP, subframeP,rnti);
       UE_list->UE_sched_ctrl[UE_id].ul_failure_timer = 0;
       UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync   = 1;
+
+      //Inform the controller about the UE deactivation. Should be moved to RRC agent in the future
+      if (rrc_agent_registered[module_idP]) {
+        LOG_W(MAC, "notify flexran Agent of UE state change\n");
+        agent_rrc_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP,
+            rnti, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
+      }
     }
   }				// ul_failure_timer>0
 
-  //Inform the controller about the UE deactivation. Should be moved to RRC agent in the future
-  if (rrc_agent_registered[module_idP]) {
-    agent_rrc_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP,
-        rnti, PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
-  }
-
   UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer++;
   if(UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer > (U_PLANE_INACTIVITY_VALUE*subframe_num(&RC.eNB[module_idP][CC_id]->frame_parms))){
     LOG_D(MAC,"UE %d rnti %x: U-Plane Failure after repeated PDCCH orders: Triggering RRC \n",UE_id,rnti);