Edge case fix for item_quantity contains condition