made changes to title function