Popup now closes when clicking outside it