made the network connection threaded