finish refresh code