Change volatile boolean to AtomicBoolean