Changed deleteItem function.