fix the template check before rendering detail view