Fix for #146

Fix for #146 that was causing the UI to be updated from a background thread.