refactoring: change the ConnectThread thread, add proper error handling/reporting