fixing logout when session expires