Update index.js

Adjusting toggle feature