fix HTTP request issue on main thread