fixed a bug that was causing brsh to remain open with a dead connection