Fix NetworkOnMainThread error