fixes for incorrect usage of UI.getCurrent in worker threads