Bug fix for when returning to the calling site outside of the popup window