fixed upload function in Firefox