worked around call-by-reference error