updated index.js and login.js