use pagebeforeshow when possible to remove transitional flicker