added 'preRender' method