Use AtomicInteger for scope ID.