fixed pem creation