Use AtomicInteger for concurrency