flush on exit fix