Add textbrowser and enhance exit functions