adding onRedraw event