fixed the title helper function