working on JavaFX thread issue