added event callback for the draw process