fixing title function