added check for protocol and version