adding closing of windows