update before submission