Fixed popup.js bug