added code in popup.js to check