Fixing refresh problem