Added a background thread that doesn't block the GUI.