catch error on read/write serialport  #17