Using Ref to implement dangling bad connection deletion.