changed render function to rendertmpl