fix pass-by-reference error