fix HTTP in main thread