fix page init function load timing

let page init function only be loaded after specified page shown