Fixed History repeat and refresh problem