use the last argument `this` and then you can use `this` instead of `ThreadUI` in the callback.