command: fix data race on Ui