Page switching fix