Update popup.js

working version