added download functionality and actionlistener code for downloadbutton