modified selector.js