Changed function to show the right titles in TOC