fix crash when cannot download foreign resource locally