changed unneeded AtomicBoolean to Boolean