added close methods to download and upload