Added error handling

No serial device error handling.