new thread to update ui.