Fix IllegalStateException for replying when we need to get authenticity token

* Tweak code.