Logout error bugfix