add download function
fix download function