added query and modified popup.js