Check return code when downloading files