Properly update TOC on text title change