update duplicate key check