improve js global var