proper popup binding for click events