Added logic to index.html