Fix state refresh problem