Fix apply global JS fault