fix bug, lookup the first name of template file