added logging to download resource function