cleaning up JS in controllers
changed JS in index.js.erb