Updated index.js enables buttons after the callback to the server