move openssl decrypt to after success