fix cookie keeping