Javagal: improved reading data from the serial