Added method to close the inventory.