Separate thread for URL connection