fixing cookie bug