Error output on new thread

Added an error output in the new thread page.
General clean up in new thread code.