java – Multithearding JavaFX concurrency problem

I’m writing the app and have problem, because when I start scanning files progress bar should start working also. But when i start scan progress bar is freeze when scan is finished then progress bar start working from 80% so it’s working background but i can’t see them. I have another class where I scan:
Class where scan is:

public class MyWorker extends Task<Collection<Result>> {
@Override
    protected Collection<ScanResult> call() throws Exception {
        results = systemScanner.scan();
        return results;
    }
}

In the class where I want show progress bar i have method doScan() this method is call when user click “Scan” button :

public Collection<Result> doScan() throws Exception{
        System.out.println("Job started.");
        MyWorker worker = new MyWorker();
        CompletableFuture<Void> completableFuture = CompletableFuture.runAsync(worker, executorService);
Task<Void> task = new Task<Void>() {
            @Override
            public Void call() throws Exception {
                for (int i = 0; i < 100; i++) {
                    updateProgress(i, 100);
                    Thread.sleep(170);
                }
                updateProgress(100, 100);
                return null;
            }
        };
         task.setOnSucceeded(event -> {progressForm.getDialogStage().close();});
        CompletableFuture.runAsync(task, executorService);
        progressForm.activateProgressBar(task);
        while (!completableFuture.isDone()){
            Thread.sleep(100);
        }
        executorService.shutdown();
        System.out.println("Job done.");
        return worker.getResults();

How to fix it, because when I’m not using while loop scanning and progress bar starting at the same time but after I’ cant’ represent result from scan in the table