added download as csv functionality