Minor change to make UI updates thread safe.