throw exception if render is used from within a template