fix NPE in cookies