changed the protocol detection