Serial error

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

And there is a simple user-input example in Planning and Implementing a Program

...R