better disconnection handling