wrap js into a global vrariable