render template correctly.