Added exception handling when opening the serial port