update before uploading