Fix refresh function on page