Function to update items.