Fixing JS issues on index.html