Added change focus functionality so that when a new page is added it switches focus to that page.