Thread work

I have a long processing activity which I do not want to run in the UI thread.
I have followed this pattern in Vaadin 7 and 8, but it is presently not working for me in Vaadin 10.
The first label shows up as expected, but the second one never does, even though the debugger shows the command is reached.

@Route("r1")
public class R1 extends VerticalLayout {

    public R1() {
		Label l = new Label("Loading... ");
		add(l);

		new Thread( () -> {
			doStuff();
			getUI().orElseThrow(() -> new IllegalStateException("Main UI not present")).access(() -> {
				Label l2 = new Label("Loaded. ");
				add(l2);
        } ).start();
    }

I’m doing that like this.

@Route("test")
public class Test extends VerticalLayout {

    private ExecutorService executorService = Executors.newSingleThreadExecutor();

    public Test() {

        Label l = new Label("Loading... ");
        add(l);

        executorService.submit(() -> {
            access(() -> {
                Label l2 = new Label("Loaded. ");
                add(l2);
            });
        });
    }

    @Override
    protected void onDetach(DetachEvent detachEvent) {
        super.onDetach(detachEvent);
        executorService.shutdown();
    }

    private void access(Command command) {
        Optional<UI> ui = getUI();
        if (ui.isPresent()) {
            ui.get().access(command);
        } else {
            command.execute();
        }
    }
}