resolve generated agetn name correctly