Added checks if templates are empty