updated updateTitle method