add code of global.js