handle if cookie is nil