Checks for duplicates