Adding connectHook for logout

see #155