changed index.js for pull query