commit before modal change