fix bug where serial port was not initialized yet.