add function to index page