Better error handling if the template is not found