Yep this is what I mean (and you should add a unit test for that)

No other issue detected but I only quickly scanned it.