update draw logic