adapted to privacy-option patch c1f0cc4.