Yes, this seems like a mistake.
I agree that contractsShowing() should not the side effect of closing something.