renaming the flush method
Cloasing application with window