Progress dialog is now also canceled in case of errors.