fixing cookie refresh problem