Fixed the thread issue down to a socket issue