fix logout bug by jamie 20141023