Fixed error of accessing UI from non-main thread