fix empty cookie bug