added try catch to ensure serial port instantiated before reading