Fixed the crashing when cancelling a download operation
Improved the exception handling for download operations