Connect function to index page