Fixed incorrect pass by reference