fixed getting cookie bug