reduced memory usage and added idle timeout for download procedures