Update main page using function.