checks for duplicates