write index page