handle network failures