Fix an issue when a user logout

Fix an issue introduced in 189536e