fix cookie creation