added preRender and postRender to update()