added basic protocol detection support