add download link, change middleware