Fix small bug on text input from a TypeError