partially fixed logout refresh