fix client destruction