accounting for bad top in table of contents script
toc script fix