add a function to reload a page by index