ensuring that the progressDialog is dismissed on success