add download file function