move page init script to mainjs