fix for loop bug, serve index.html