adding fix to log out handling properly