diff --git a/web/themes/asc_bootstrap/asc_bootstrap.theme b/web/themes/asc_bootstrap/asc_bootstrap.theme
index e204f0a911182a975cf1c3b0103edd447b4a792b..8a8cf64e91c7eb7187df658729db81e5a0e5e819 100755
--- a/web/themes/asc_bootstrap/asc_bootstrap.theme
+++ b/web/themes/asc_bootstrap/asc_bootstrap.theme
@@ -55,8 +55,8 @@ function asc_bootstrap_theme_suggestions_page_alter(array &$suggestions, array $
 * adds content type to variable to be used in paragraph twig files.
 */
 function asc_bootstrap_preprocess_paragraph(&$variables) {
-  $node = \Drupal::request()->attributes->get('node');
-  if ($node != null) {
+  if (\Drupal::routeMatch()->getRouteName() == 'entity.node.canonical') {
+    $node = \Drupal::routeMatch()->getParameter('node');
     $variables['page_content_type'] = $node->getType();
   }
 }