new method for choosing which page to render