modified for dynamic multiple file upload