i wonder why you check `input.fail()` here and also line 225.