mw: remove all modes when closing window