Another attempt to fix dup key issue