small fix for render-template function