change the way socket disconnects