added funtion for index page