fix bug onRedraw event handler