use a generator to allocate UIDs