Fix page refresh problem