switch from pageinit to pagebeforeshow