Changed so exceptions stop the thread instead of crashing the system