Fix JS error - do not create a toc element if the parent toc container does not exist