added download data functionality