Improve client reconnection handling