fixing toctree loop