improved entry title function with schema