fix mod_gate assert crash