Fixed npe during logout
fixed #80