Wait in main thread