added a callback for onRender