I want to modify part of a set of equations using `WhenEvent`

in `NDSolve`

. I have made an example of much less complicated minimum work as follows:

```
sol = x /. First@NDSolve[{
x''
If[x
50 x
16 50 x
x'[0] == 0,
x[0] == 1
},
{x}, {t, 0, 2}];
Plot[sol
```

It doesn’t use `WhenEvent`

but changes a term in the equation. Now i'm trying to present a `WhenEvent`

. I also introduce a module that contains both versions of the term in the equation.

```
ClearAll[ff];
ff[status_, t_?NumericQ, x_?NumericQ] :=
If[x < 0,
Sow[{t, x, -1, status}, tag1]; 50 x ,
Sow[{t, x, 1, status}, tag1]; 16 50 x ];
status = "More";
a = Reap[
res = Reap[
sol = x /. First@NDSolve[{
x''
ff[status, t, x
x'[0] == 0, x[0] == 1,
WhenEvent[x
If[x
Sow[{t, x
{x}, {t, 0, 2}];,
tag1];,
tag2];
Plot[sol
Epilog -> {Line[res[[2, 1, All, {1, 3}]]], Red, PointSize[0.01],
Point[a[[2, 1, All, {1, 2}]]]}]
```

It also worked and both `Sow`

the functions collect various values which show that everything works. I have introduced a state value which indicates which of the two states I am. I would like to use the state value to control the switching of the term in the differential equation. So I modify the function `ff`

so the status is examined rather than the value of the variable. It does not work.

```
ClearAll[ff];
ff[status_, t_?NumericQ, x_?NumericQ] :=
If[status == "Less",
Sow[{t, x, -1, status}, tag1]; 50 x ,
Sow[{t, x, 1, status}, tag1]; 16 50 x ];
status = "More";
a = Reap[
res = Reap[
sol = x /. First@NDSolve[{
x''
ff[status, t, x
x'[0] == 0, x[0] == 1,
WhenEvent[x
If[x
Sow[{t, x
{x}, {t, 0, 2}];,
tag1];,
tag2];
Plot[sol
Epilog -> {Line[res[[2, 1, All, {1, 3}]]], Red, PointSize[0.01],
Point[a[[2, 1, All, {1, 2}]]]}]
```

Why it does not work? How can I fix it?