add generating title function