Added try-finally block for file downloader