Updated version for the new popupviewer.