Remove trivial (degree=2) vertices before detecting bridges like in after