Fixing download code