add privacy middleware