Avoid searching for item in database when item is already available.
Do not add elements to database when editing an item.
Added warning.