added better traceback in case of thread error