Made changes to enable use of delegation with popover