Change reconnection implementation a bit