template checking outside of view