Added hiding the popover by clicking anywhere outside the box.