Update ids and toc