using Interlocked.Increment for id handling instead of dictionary. Less locking seems to make it more robust when under stress.