Logout error fix