Ensured main thread