add double-encoding prevention