updated and simplified the javascript fot multiple file upload