made a few changes to download function for decrypt ability#