add popups with js closure