fixed downloadExternalData function