add onRender function to sense the draw function trigger set connection method