try to do less stuff on ui thread