Trying to switch logic for page switch