fix the index.html logic