update the function to call on the main page