add the refresh function for the page