Fix async constructor to check main thread