fix gating