fix bug where clients weren't closed