"Grandchildren" 3rd level menu items not working

Hi everyone. I’m trying to create a 3 level deep menu. The second level works but the “grandchildren” don’t. Can someone advise me on where I can find the answers to this problem.
Thanks!

<ul class="menu">
        {% for page in pages.children.visible %}
            {% set current_page = (page.active or page.activeChild) ? 'active' : '' %}
            <li class="{{ current_page }}">
                <a href="{{ page.url }}">{{ page.menu }}</a>
                {% if page.children %}
                  <ul class="">
                  {% for child in page.children %}
                      {% if child.visible %}
                        {% set current_page = (page.active or page.activeChild) ? 'active' : '' %}
                          <li class="{{ current_page }}">
                            <a href="{{ child.url }}">{{ child.menu }}</a>
                            {% set grandchild = child.getChildren %}

                              <ul class="">
                                {% for grandchild in child.get_children %}
                                      <li class= "{{ current_page }}">
                                        <a href="{{ grandchild.url }}">{{ grandchild.menu }}</a>
                                      </li>
                              {% endfor %}
                              </ul>

                          </li>
                      {% endif %}
                  {% endfor %}
                  </ul>
                {% endif %}
            </li>
        {% endfor %}
</ul>
---

solved: for anyone needing a 3 level menu, here you go:

<ul class="menu">
  {% for page in pages.children.visible %}
  {% set current_page = (page.active or page.activeChild) ? 'active' : '' %}
  <li class="{{ current_page }}">
      <a href="{{ page.url }}">{{ page.menu }}</a>
      {% if page.children %}
        <ul class="">
        {% for child in page.children %}
            {% if child.visible %}
              {% set current_page = (page.active or page.activeChild) ? 'active' : '' %}
                <li class="{{ current_page }}">
                  <a href="{{ child.url }}">{{ child.menu }}</a>

                    <ul class="">
                      {% for grandchild in child.children %}
                            <li class="{{ current_page }}">
                              <a href="{{ grandchild.url }}">{{ grandchild.menu }}</a>
                            </li>
                    {% endfor %} 
                    </ul>

                </li>
            {% endif %}
        {% endfor %}
        </ul>
      {% endif %}
  </li>
  {% endfor %}
</ul>
---