fixing the gate