parse protocol version properly