Bug fix in client disconnect