made close() idempotent. Not sure it helps...