fix small popover error

make sure the element has had popover applied before trying to call it.