moving onRender where it belongs