Adding logic for download button