Added register setting
Now it free the window on close, and I found the right menu item to use