update the render function