fix for ip reconnect bug and tls