Fixing download memory leak