update logic for connection failure