fix typecheck on cookie