fix some logout issues