closing unwanted windows automatically