Check for duplicates in the stream and filter them or throw an error