! Fix a bug for finding template with format