close function added