Fixing popover bug