if we don't have a threadId, stored will be undefined here (`thread[thread.length - 1]`). So isDistinct will always return true. Is it what you want?