fix client shutdown