diff --git a/modules/content_management/applet_controller.php b/modules/content_management/applet_controller.php
index 066504d46962f3266ee325b171e711a3f68116b2..fec70dbb902a3e03fa4d071781d2d3d62c215d3f 100755
--- a/modules/content_management/applet_controller.php
+++ b/modules/content_management/applet_controller.php
@@ -357,6 +357,13 @@ if (!empty($_REQUEST['action'])
             );
             createXML('ERROR', $result);
         }
+    } elseif ($_REQUEST['action'] == 'terminate') {
+        if (file_exists($file)) {
+            unset($_SESSION['cm_applet'][$_SESSION['user']['UserId']][$_REQUEST['idApplet']]);
+            unlink($file);
+        }
+
+        createXML('SUCCESS', ['END_MESSAGE' => 'Terminate ok']);
     } elseif ($_REQUEST['action'] == 'sendPsExec') {
         $pathToPsExec = 'modules/content_management/dist/PsExec.exe';
         if (file_exists($pathToPsExec)) {
diff --git a/src/app/contentManagement/controllers/JnlpController.php b/src/app/contentManagement/controllers/JnlpController.php
index 436a494fb3fd350ff8db3499139e4df61df77413..6e9992c00771ca64a342c1bb6a5847348723f218 100644
--- a/src/app/contentManagement/controllers/JnlpController.php
+++ b/src/app/contentManagement/controllers/JnlpController.php
@@ -278,15 +278,13 @@ class JnlpController
                 }
             }
 
-            $result = ['END_MESSAGE' => 'Update ok'];
-            $xmlResponse = JnlpController::generateResponse(['type' => 'SUCCESS', 'data' => $result]);
+            $xmlResponse = JnlpController::generateResponse(['type' => 'SUCCESS', 'data' => ['END_MESSAGE' => 'Update ok']]);
         } elseif ($data['action'] == 'terminate') {
             if (file_exists("{$tmpPath}{$GLOBALS['userId']}_maarchCM_{$aArgs['jnlpUniqueId']}.lck")) {
                 unlink("{$tmpPath}{$GLOBALS['userId']}_maarchCM_{$aArgs['jnlpUniqueId']}.lck");
             }
 
-            $result = ['END_MESSAGE' => 'Terminate ok'];
-            $xmlResponse = JnlpController::generateResponse(['type' => 'SUCCESS', 'data' => $result]);
+            $xmlResponse = JnlpController::generateResponse(['type' => 'SUCCESS', 'data' => ['END_MESSAGE' => 'Terminate ok']]);
         } else {
             $result = [
                 'STATUS' => 'ko',