make it work for 3 level of toc