fix cookie-check bug