Added error case for lost network connections.