add PEM writer