Fixed a bug where the ProgressDialog from the previous commit doesn't get dismissed