fixing switch page error