cookie null bug fix