cleanup of popup.js