added closing of windows