fixed unique constraint handling once more