Method modified to update the GUI from the backend