change the way of determining protocol