Define number of buttons in javascript
Hotfix of a bug that caused the code not to work