checkMainThread