Minor fix
performance fix in checkduplicate