changed to AtomicBoolean to not have JavaFX as a dependency