fix bug with rendering popover on nonexistent div