update before the submission