implement fix for temporary objects from Neal Erhardt, commit 52ddbfde1e5a59739274ecb2920ee92c74c1e282