add flush events method