Fix up the threading issue -- use an AtomicBoolean to make sure to process items in the queue from the same thread