Adds close window if it's a popup request