Added condition to set pageShow to correct number