fix protocol detection

closes #55