fixed updating UI in thread bug