handle cleanup on server side disconnections/error