fix file refresh code