Fix call by reference error