give Template a little more error handling