added eventlistener to fire the function when a file is selected, not dragged (now it works both ways)