Fixes pass by reference error