Fixed error handling code for URL download failing