only support main thread