Update index.js

Bugfix: couldn't click twice on categories.