hardening update code for #334