proper cleanup on disconnect