added download file function