added refresh code