further cleanup of file upload