Fix bug where no page is selected