Modify delete() in ItemList class

delete the item according to the index.