Added EndFlush event