add download logic