update draw function