client hangs after shutdown fixes #issue821

#821