modified popup.js