error checking on modem read and typofix