diff --git a/modules/Settings/LayoutEditor/actions/Block.php b/modules/Settings/LayoutEditor/actions/Block.php
index ea3345a8ddb7d8bc25e890aed0fddaf27632e0c2..ae22b4a4a500b5338a86d0fad626d3c6d113c1d0 100644
--- a/modules/Settings/LayoutEditor/actions/Block.php
+++ b/modules/Settings/LayoutEditor/actions/Block.php
@@ -80,8 +80,8 @@ class Settings_LayoutEditor_Block_Action extends Settings_Vtiger_Index_Action {
         $response = new Vtiger_Response();
         $blockId = $request->get('blockid');
         $checkIfFieldsExists = Vtiger_Block_Model::checkFieldsExists($blockId);
-        if(!$checkIfFieldsExists) {
-            $response->setError('502','Fields not exists for the block');
+        if($checkIfFieldsExists) {
+            $response->setError('502','Fields exists for the block');
             $response->emit();
             return;
         }