diff --git a/src/Middleware/RoleMiddleware.php b/src/Middleware/RoleMiddleware.php
index <HASH>..<HASH> 100644
--- a/src/Middleware/RoleMiddleware.php
+++ b/src/Middleware/RoleMiddleware.php
@@ -56,15 +56,23 @@ class RoleMiddleware
      */
     public function handle(Request $request, Closure $next, $role)
     {
-        if (!$user = $this->authRepositoryInterface->getActiveUser()) {
+        if ($request->ajax()) {
+            return response('Unauthorized', 401);
+        }
 
+        if (!$user = $this->authRepositoryInterface->getActiveUser()) {
             Flash::error('Access Denied');
 
             return redirect()->route('auth.login');
         }
 
-        if (!($role = $this->roleRepositoryInterface->getBySlug($role)) || !$user->inRole($role)) {
+        if (!$role = $this->roleRepositoryInterface->getBySlug($role)) {
+            Flash::error('Access Denied');
+
+            return redirect()->route('auth.unauthorized');
+        }
 
+        if (!$user->inRole($role)) {
             Flash::error('Access Denied');
 
             return redirect()->route('auth.unauthorized');
Reverted RoleMiddleware back to what it was before things started breaking.