Fix the network in main thread problem