fix operation with duplicate item in database