update in thread end