Fix issue where using popup causes the page to return to the original page