update page titles function