Update index.html

updated to use before functions