fix cookie check