fix the no javascript context with thread issue