refresh function finish