template check before rendering