added decrypt to download function