fixed cookie bug