Clicking outside of the popup closes the popup