update show toc logic