download button was not working. assigned proper event to run download fucntion