use ResourceNotFoundException to replace TemplateNotFoundException