Add more network failure handling code