*the* bug was here, missing the assignment to `state =`
but I see now that the bug did not exist before my changes, so it was introduced by my changes
ah, sorry, then it was not easy to spot