window close function added