moved logging to UI thread