diff --git a/layout_builder_modal.module b/layout_builder_modal.module
index d2089b8..e9acfff 100644
--- a/layout_builder_modal.module
+++ b/layout_builder_modal.module
@@ -105,45 +105,46 @@ function _layout_builder_modal_dialog_options(\Drupal\Core\Config\ImmutableConfi
   // Set title of modal based on block type or block label.
   // Load the SectionComponent based on $route_parameters['uuid'] so we can load the block.
   $nid = str_replace('node.', '', $route_parameters['section_storage']);
-  $node = Node::load($nid);
-  $layout = $node->get('layout_builder__layout');
-  $sections = $layout->getSections();
-  foreach ($sections as $key => $section) {
-    $components = $section->getComponents();
-    foreach ($components as $component) {
-      if ($component instanceof SectionComponent && isset($route_parameters['uuid']) && $component->getUuid() == $route_parameters['uuid']) {
-        $configuration = $component->get('configuration');
-        $base_plugin_id = explode(PluginBase::DERIVATIVE_SEPARATOR, $configuration['id'])[0];
-
-        // If base plugin ID is inline_block, we can assume entity_type is block_content.
-        // Retrieve the block type/bundle and use it in the modal title.
-        if ($base_plugin_id === 'inline_block' && isset($configuration['block_revision_id'])) {
-          $block = \Drupal::entityTypeManager()->getStorage('block_content')->loadRevision($configuration['block_revision_id']);
-          $block_type = $block->get('type')->getValue()[0]['target_id'];
-          $entity_type_bundle_info = \Drupal::service('entity_type.bundle.info');
-          $block_type_label = $entity_type_bundle_info->getBundleInfo('block_content')[$block_type]['label'];
-          $modal_title = t('Configure block: ' . $block_type_label);
-        }
-        // Otherwise use label set in SectionComponent config.
-        else if (!empty($configuration['label'])) {
-          $modal_title = t('Configure block: ' . $configuration['label']);
-        }
-        // If no label set in SectionComponent config, try to construct one depending on the base plugin.
-        else {
-          switch ($base_plugin_id) {
-            case 'views_block':
-              $block_manager = \Drupal::service('plugin.manager.block');
-              $plugin_block = $block_manager->createInstance($configuration['id'], []);
-              $view_label = $plugin_block->getViewExecutable()->storage->label();
-              $current_display = $plugin_block->getViewExecutable()->current_display;
-              $display_label = $plugin_block->getViewExecutable()->storage->getDisplay($current_display)['display_title'];
-              $modal_title = t('Configure block: ' . $view_label . ': ' . $display_label);
-
-              break;
+  if($node = Node::load($nid)) {
+    $layout = $node->get('layout_builder__layout');
+    $sections = $layout->getSections();
+    foreach ($sections as $key => $section) {
+      $components = $section->getComponents();
+      foreach ($components as $component) {
+        if ($component instanceof SectionComponent && isset($route_parameters[' uuid']) && $component->getUuid() == $route_parameters['uuid']) {
+          $configuration = $component->get('configuration');
+          $base_plugin_id = explode(PluginBase::DERIVATIVE_SEPARATOR, $configuration['id'])[0];
+  
+          // If base plugin ID is inline_block, we can assume entity_type is  block_content.
+          // Retrieve the block type/bundle and use it in the modal title.
+          if ($base_plugin_id === 'inline_block' && isset($configuration['  block_revision_id'])) {
+            $block = \Drupal::entityTypeManager()->getStorage('block_content')->  loadRevision($configuration['block_revision_id']);
+            $block_type = $block->get('type')->getValue()[0]['target_id'];
+            $entity_type_bundle_info = \Drupal::service('entity_type.bundle.info' );
+            $block_type_label = $entity_type_bundle_info->getBundleInfo(' block_content')[$block_type]['label'];
+            $modal_title = t('Configure block: ' . $block_type_label);
+          }
+          // Otherwise use label set in SectionComponent config.
+          else if (!empty($configuration['label'])) {
+            $modal_title = t('Configure block: ' . $configuration['label']);
           }
+          // If no label set in SectionComponent config, try to construct one   depending on the base plugin.
+          else {
+            switch ($base_plugin_id) {
+              case 'views_block':
+                $block_manager = \Drupal::service('plugin.manager.block');
+                $plugin_block = $block_manager->createInstance($configuration['id '], []);
+                $view_label = $plugin_block->getViewExecutable()->storage->label( );
+                $current_display = $plugin_block->getViewExecutable()-> current_display;
+                $display_label = $plugin_block->getViewExecutable()->storage->  getDisplay($current_display)['display_title'];
+                $modal_title = t('Configure block: ' . $view_label . ': ' . $display_label);
+  
+                break;
+            }
+          }
+  
+          break;
         }
-
-        break;
       }
     }
   }
