fixing pem creation