Change how server connection is closed