Fixed passed by reference error