fixed build order bug in index.html generation logic