Fix dead connection detection and removal process