diff --git a/src/core/controllers/AuthenticationController.php b/src/core/controllers/AuthenticationController.php
index 80cc5ada7615d8c072ea4e865cb65e9645e9ed73..d480649774ec631be34a6d7536e2cf5dfd2441a0 100755
--- a/src/core/controllers/AuthenticationController.php
+++ b/src/core/controllers/AuthenticationController.php
@@ -725,10 +725,21 @@ class AuthenticationController
             'PUT/installer/administrator', 'DELETE/installer/lock'
         ];
 
-        if (is_file("custom/custom.json")) {
-            return false;
-        } elseif (!in_array($args['route'], $installerRoutes)) {
+        if (!in_array($args['route'], $installerRoutes)) {
             return false;
+        } elseif (is_file("custom/custom.json")) {
+            $customs = scandir('custom');
+            if (count($customs) > 4) {
+                return false;
+            }
+            foreach ($customs as $custom) {
+                if (in_array($custom, ['custom.json', '.', '..'])) {
+                    continue;
+                }
+                if (!is_file("custom/{$custom}/initializing.lck")) {
+                    return false;
+                }
+            }
         }
 
         return true;