fix #11 but without pem stuff