What happens when a page is rendered