Added error case for lost network connections. (bug fix)