changes to avoid "not on FX thread" errors