fixed cookie bugs