added event so popover will close when user clicks outside of the view