fix regression from mistakenly assuming pass-by-reference