Added functionality to logout() and shutdown()