cleaning up server to client communication on closing