update index.js for voting