fix error on client disconnect