fixed protocol switching if handshake hangs