replaces nextIdLock with AtomicInteger