Trying a close function