changed pop-up window close function