Logout error bug fix