Fix popover when closing modal