fixed bug with network in main thread