Assignment of function parameter has no effect outside the function. Fixed with a reference to avoid changing every call of the function.