update main.js for pageinit