made a mistake implementing the popuptemplate.