revamping way we capture bad connection
fixes to potential memory leaks from clang