added onRender method