Index: app/Http/Controllers/Dashboard/DepartmentsController.php
===================================================================
--- app/Http/Controllers/Dashboard/DepartmentsController.php	(revision b6e0879c61aa840154526fdd55be69388936187f)
+++ app/Http/Controllers/Dashboard/DepartmentsController.php	(revision 233e9501709cd9c95df69d2b138149cb573b4917)
@@ -144,7 +144,7 @@
         }
         catch(\Exception $e){
-            abort(403, "No files found");
-            //Alert::flash(" deleted successfully");
-            //return redirect()->route("dashboard.departments.index");
+            //abort(403, "No files found");
+            Alert::flash("All departments are empty", "warning");
+            return redirect()->back();
     }
     }
@@ -176,5 +176,7 @@
         }
         catch(\Exception $e){
-            abort(403, "No files found");
+            //abort(403, "No files found");
+            Alert::flash("This department has no files", "warning");
+            return redirect()->back();
         }
     }
Index: app/Http/Controllers/Dashboard/FoldersController.php
===================================================================
--- app/Http/Controllers/Dashboard/FoldersController.php	(revision b6e0879c61aa840154526fdd55be69388936187f)
+++ app/Http/Controllers/Dashboard/FoldersController.php	(revision 233e9501709cd9c95df69d2b138149cb573b4917)
@@ -303,5 +303,7 @@
         }
         catch (\Exception $e) {
-            abort(403, "No files found");
+            //abort(403, "No files found");
+            Alert::flash("This folder has no files", "warning");
+            return redirect()->back();
         }
     }
Index: database/factories/FolderFactory.php
===================================================================
--- database/factories/FolderFactory.php	(revision b6e0879c61aa840154526fdd55be69388936187f)
+++ database/factories/FolderFactory.php	(revision 233e9501709cd9c95df69d2b138149cb573b4917)
@@ -30,4 +30,6 @@
         $deptId = Arr::random($inputArray);
 
+        //$deptId = $this->faker->numberBetween(1, 10);
+
         $deptCode = Department::find($deptId)->code;
 
