Handle unique constraint