check nil in template