As above, turn the event off in the `beforeClose` method.