Fixed error when serial port error.