Not accessing first element of popover elemnt, which is undefined