Fix bug introduced in #137

Need to call the render function in the correct context.