fixed refresh code