Made the page selection work