Created updatePageTitle function