Fixed logout bug for anonymous user