fixed gui exception, while cleaning the table of contents