Properly close hashlist