made template less exception-happy