diff --git a/api/admin/editVideo.php b/api/admin/editVideo.php
index 72af798d78cc3b25f532da6d46d92f6993f7ed72..2fbb178aa597e5c4d3d673e233b5bc17d4427a9e 100644
--- a/api/admin/editVideo.php
+++ b/api/admin/editVideo.php
@@ -4,8 +4,10 @@ require_once '../../config/config.php';
 require_once '../../app/core/App.php';
 require_once '../../app/core/Database.php';
 require_once '../../app/models/VideoModel.php';
+require_once '../../app/models/ProgressModel.php';
 
 $video_model = new VideoModel();
+$progress_model = new ProgressModel();
 $xml = file_get_contents('php://input');
 $data = json_decode($xml, true);
 
@@ -22,8 +24,23 @@ if (isset($data['order'])) {
 
 if (isset($_POST['delete'])) {
     $video_id = $_POST['video_id'];
+    $module_id = $_POST['module_id'];
+    $user_id = $_POST['user_id'];
 
     $video_model->deleteVideo($video_id);
+
+    $video_count = $video_model->getVideoCountByModuleId($module_id);
+    $video_finished_count = $progress_model->getUserVideoFinishedCount($user_id, $module_id);
+
+    if ($video_count == $video_finished_count) {
+        $isProgress = $progress_model->isProgress($user_id, $module_id);
+        if ($isProgress == 0) {
+            $progress_model->addModuleResult($user_id, $module_id);
+        }
+    }
+    if ($video_count == 0) {
+        $progress_model->deleteProgress($user_id, $module_id);
+    }
     header('Location: ../../../../admin/manage/' . $_POST['language_id'] . '/' . $_POST['module_id']);
 } else if (isset($_POST['videoName']) && isset($_POST['new-video']) && isset($_POST['order']) && isset($_POST['module_id'])) {
     $data['video_id'] = $_POST['video_id'];
diff --git a/api/admin/video.php b/api/admin/video.php
index b2bd2d3e492d4110466a5c202d440168faa54c1d..562b1afd9240869d7551fab9401dee6cd9adc823 100644
--- a/api/admin/video.php
+++ b/api/admin/video.php
@@ -4,8 +4,10 @@ require_once '../../config/config.php';
 require_once '../../app/core/App.php';
 require_once '../../app/core/Database.php';
 require_once '../../app/models/VideoModel.php';
+require_once '../../app/models/ProgressModel.php';
 
 $video_model = new VideoModel();
+$progress_model = new ProgressModel();
 $xml = file_get_contents('php://input');
 $data = json_decode($xml, true);
 
@@ -27,7 +29,12 @@ if (isset($_POST['videoName']) && isset($_POST['new-video']) && isset($_POST['or
     $data['video_order'] = $_POST['order'];
     $data['module_id'] = $_POST['moduleId'];
 
+
     $video_model->addVideo($data);
-    header('Location: /admin/manage/' . $_POST['languageId'] . '/' . $_POST['moduleId']);
-    echo json_encode(array('status' => 'success', 'message' => 'VIdeo created'));
+    $isProgress = $progress_model->isProgress($_POST['user_id'], $data['module_id']);
+    if ($isProgress == 1) {
+        $progress_model->deleteProgress($_POST['user_id'], $data['module_id']);
+    }
+    header('Location: /admin/manage/' . $_POST['languageId'] . '/' . $data['module_id']);
+    echo json_encode(array('status' => 'success', 'message' => 'Video created'));
 }
\ No newline at end of file
diff --git a/app/controllers/Admin.php b/app/controllers/Admin.php
index 82126737b48d3659c51e9f904ef4ed539777d434..784a57ea59bed804cb3d5a48c365c9631e4ed4ab 100644
--- a/app/controllers/Admin.php
+++ b/app/controllers/Admin.php
@@ -233,6 +233,7 @@ class Admin extends Controller {
         return;
       }
       $this->show404();
+      exit();
     }
   }
 
@@ -242,6 +243,7 @@ class Admin extends Controller {
         return;
       }
       $this->show404();
+      exit();
     }
   }
 
@@ -251,6 +253,7 @@ class Admin extends Controller {
         return;
       }
       $this->show404();
+      exit();
     }
   }
 }
\ No newline at end of file
diff --git a/app/controllers/Learn.php b/app/controllers/Learn.php
index e9d3098f2ce2ae952752ed19225100d672324133..d88a0e5ce7e3823197745e33c7b67fee940ddeaa 100644
--- a/app/controllers/Learn.php
+++ b/app/controllers/Learn.php
@@ -93,6 +93,7 @@ class Learn extends Controller {
     // No parameter
     } else {
       $this->show404();
+      exit();
     }
   }
 
@@ -102,6 +103,7 @@ class Learn extends Controller {
         return;
       }
       $this->show404();
+      exit();
     }
   }
 
@@ -111,6 +113,7 @@ class Learn extends Controller {
         return;
       }
       $this->show404();
+      exit();
     }
   }
 
@@ -120,6 +123,7 @@ class Learn extends Controller {
         return;
       }
       $this->show404();
+      exit();
     }
   }
 }
diff --git a/app/models/ProgressModel.php b/app/models/ProgressModel.php
index c3ad62c986a4e546d67e0682df7a62155714b347..f6681fb58d10af6ea3f16ece0ed210afe7337e15 100644
--- a/app/models/ProgressModel.php
+++ b/app/models/ProgressModel.php
@@ -57,6 +57,25 @@ class ProgressModel
     return $this->db->execute();
   }
 
+  public function deleteProgress($user_id, $module_id)
+  {
+    $query = 'DELETE FROM modules_result WHERE user_id = :user_id AND module_id = :module_id';
+    $this->db->query($query);
+    $this->db->bind('user_id', $user_id);
+    $this->db->bind('module_id', $module_id);
+    return $this->db->execute();
+  }
+
+  public function isProgress($user_id, $module_id)
+  {
+    $query = 'SELECT COUNT(*) FROM modules_result WHERE user_id = :user_id AND module_id = :module_id';
+    $this->db->query($query);
+    $this->db->bind('user_id', $user_id);
+    $this->db->bind('module_id', $module_id);
+    $temp = $this->db->single();
+    return intval($temp["count"]);
+  }
+
   public function isUserVideoFinished($user_id, $video_id)
   {
     $query = 'SELECT COUNT(*) FROM videos_result WHERE user_id = :user_id AND video_id = :video_id';
diff --git a/app/views/admin/create/video/index.php b/app/views/admin/create/video/index.php
index f9b3de9153f9df0d04585d736c4584367e2c5062..7bc18a8bb99f84c2f9977df7855d205677275d7d 100644
--- a/app/views/admin/create/video/index.php
+++ b/app/views/admin/create/video/index.php
@@ -11,6 +11,7 @@ $video = '/public/video/default.mp4';
     <form action="../../../../../api/admin/video.php" method="post">
       <input type="hidden" name="moduleId" id="module_id" value="<?= $data["moduleId"] ?>">
       <input type="hidden" name="languageId" value="<?= $data["languageId"] ?>">
+      <input type="hidden" name="user_id" value="<?= $_SESSION['user_id'] ?>">
       <div class="text-input-container">
         <label for="videoName" class="text-reg text-black text-xs">Video name</label>
         <input id="name-input" type="text" name="videoName" placeholder="Video name" class="font-reg text-black text-sm" autocomplete="false" required>
diff --git a/app/views/admin/edit/video/index.php b/app/views/admin/edit/video/index.php
index 25f060cd81f8d27cac0e632c11509eca8e653ebb..204f6a14f3c6865fdc6b5d9feb9c602031f50251 100644
--- a/app/views/admin/edit/video/index.php
+++ b/app/views/admin/edit/video/index.php
@@ -31,6 +31,7 @@ $video = $data["video"]["video_url"];
       <input type="hidden" name="video_id" value="<?= $data["video"]["video_id"] ?>">
       <input type="hidden" name="video_order" value="<?= $data["video"]["video_order"] ?>">
       <input type="hidden" name="language_id" value="<?= $data["languageId"] ?>">
+      <input type="hidden" name="user_id" value="<?= $_SESSION['user_id'] ?>">
       <div class="text-input-container">
         <label for="videoName" class="text-reg text-black text-xs">Video name</label>
         <input id="name-input" type="text" name="videoName" placeholder="Video name" class="font-reg text-black text-sm" autocomplete="false" value="<?= $data["video"]["video_name"] ?>">
diff --git a/app/views/video/index.php b/app/views/video/index.php
index 962e0eb5d5a3b29fd949bd25a185a5a66a078ffd..32ee101f22dad1e61eaeae145c34542be9a4914e 100644
--- a/app/views/video/index.php
+++ b/app/views/video/index.php
@@ -22,7 +22,7 @@
                 <input type="hidden" name="module_id" value="<?= $data["module_id"] ?>">
                 <input type="hidden" name="language_id" value="<?= $data["language_id"] ?>">
                 <input type="hidden" name="user_id" value="<?= $data["user_id"] ?>">
-                <button type="submit" class="distinct-button font-reg text-sm" id="btn-finish">
+                <button type="submit" class="primary-button font-reg text-sm" id="btn-finish">
                     Next
                 </button>
             </div>