diff --git a/_includes/nav.html b/_includes/nav.html
index 45c83d5f345f8788ea0d3c8619c631aca12e726c..93dcf210b46572d4beb55ce2345d31f5f8fe4db6 100644
--- a/_includes/nav.html
+++ b/_includes/nav.html
@@ -29,7 +29,7 @@
                     {%- endif -%}
                     <a href="{{ child.url | absolute_url }}" class="navigation-list-link{% if page.url == child.url %} active{% endif %}">{{ child.title }}</a>
                     {%- if child.has_children -%}
-                        {%- assign grand_children_list = pages_list | where: "parent", child.title -%}
+                        {%- assign grand_children_list = pages_list | where: "parent", child.title | where: "grand_parent", node.title -%}
                         <ul class="navigation-list-child-list">
                         {%- for grand_child in grand_children_list -%}
                           <li class="navigation-list-item {% if page.url == grand_child.url %} active{% endif %}">
diff --git a/_layouts/default.html b/_layouts/default.html
index 32d149ba5bb2fdcd293d258e73eba823c42d12d6..4ab8693072dc866385f4be6ec85423dffdd95cf8 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -83,8 +83,9 @@ layout: table_wrappers
             <hr>
             <h2 class="text-delta">Table of contents</h2>
             <ul>
-              {% for child in pages_list %}
-                {% if child.parent == page.title and child.title != page.title %}
+              {%- assign children_list = pages_list | where: "parent", node.title -%}
+              {% for child in children_list %}
+                {% if child.parent == page.title and child.title != page.title and child.grand_parent == page.parent %}
                 <li>
                   <a href="{{ child.url | absolute_url }}">{{ child.title }}</a>{% if child.summary %} - {{ child.summary }}{% endif %}
                 </li>