Fix bug with thread not running under ui thread...