client close bug fix