Adding logic to handle unexpected network error