update ui using thread