tweak to update_cb to check for duplicates