Updated message function in index page